TwitterAPI: Add tag timeline.

This commit is contained in:
Roger Braun 2017-09-17 11:45:16 +02:00
parent b7b3e3f263
commit 255a681782
2 changed files with 17 additions and 0 deletions

View File

@ -120,6 +120,7 @@ defmodule Pleroma.Web.Router do
end end
get "/search", TwitterAPI.Controller, :search get "/search", TwitterAPI.Controller, :search
get "/statusnet/tags/:tag", TwitterAPI.Controller, :public_and_external_timeline
get "/externalprofile/show", TwitterAPI.Controller, :external_profile get "/externalprofile/show", TwitterAPI.Controller, :external_profile
end end

View File

@ -490,4 +490,20 @@ defmodule Pleroma.Web.TwitterAPI.ControllerTest do
assert status["id"] == activity.id assert status["id"] == activity.id
end end
end end
describe "GET /api/statusnet/tags/timeline/:tag.json" do
test "it returns the tags timeline" do
user = insert(:user)
user_two = insert(:user, %{nickname: "shp@shitposter.club"})
{:ok, activity} = CommonAPI.post(user, %{"status" => "This is about #2hu"})
{:ok, _} = CommonAPI.post(user_two, %{"status" => "This isn't"})
conn = conn
|> get("/api/statusnet/tags/2hu.json")
assert [status] = json_response(conn, 200)
assert status["id"] == activity.id
end
end
end end