aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2020-07-01 21:12:59 -0500
committerAlex Gleason <alex@alexgleason.me>2020-07-18 19:35:07 -0500
commitafa8b469ed0a71247f27efec08d6eeac24b6674f (patch)
tree20c62bbf4a7013d026744f44da45efe77c678aac /test
parent10d46235cfae03901c297473043a5700a8c5e4f0 (diff)
downloadpleroma-afa8b469ed0a71247f27efec08d6eeac24b6674f.tar.gz
Allow restricting public timeline by instance
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/controllers/timeline_controller_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/timeline_controller_test.exs b/test/web/mastodon_api/controllers/timeline_controller_test.exs
index 50e0d783d..6acd512c7 100644
--- a/test/web/mastodon_api/controllers/timeline_controller_test.exs
+++ b/test/web/mastodon_api/controllers/timeline_controller_test.exs
@@ -140,6 +140,18 @@ defmodule Pleroma.Web.MastodonAPI.TimelineControllerTest do
activities = json_response_and_validate_schema(res_conn, 200)
[%{"id" => ^activity_id}] = activities
end
+
+ test "can be filtered by instance", %{conn: conn} do
+ user = insert(:user, ap_id: "https://lain.com/users/lain")
+ insert(:note_activity, local: false)
+ insert(:note_activity, local: false)
+
+ {:ok, _} = CommonAPI.post(user, %{status: "test"})
+
+ conn = get(conn, "/api/v1/timelines/public?instance=lain.com")
+
+ assert length(json_response_and_validate_schema(conn, :ok)) == 1
+ end
end
defp local_and_remote_activities do