diff options
author | kaniini <ariadne@dereferenced.org> | 2019-10-07 11:40:31 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-10-07 11:40:31 +0000 |
commit | 079d069eb43804ffc87f2bb53426d4c8dc34b111 (patch) | |
tree | 2e7753bc6785ea1585b927c915844a121d0c3202 /test | |
parent | cb36fe0128c2da9480e543ae5d71768bd73af239 (diff) | |
parent | 790ae8e18963487f6e63fbd12407acd9a0ef1c76 (diff) | |
download | pleroma-079d069eb43804ffc87f2bb53426d4c8dc34b111.tar.gz pleroma-079d069eb43804ffc87f2bb53426d4c8dc34b111.zip |
Merge branch 'backport/remove-direct-messages-from-public-timeline' into 'maint/1.1'
backport: Mastodon API: Fix private and direct statuses not being filtered out from the...
See merge request pleroma/pleroma!1807
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/mastodon_api_controller_test.exs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/web/mastodon_api/mastodon_api_controller_test.exs b/test/web/mastodon_api/mastodon_api_controller_test.exs index 24e5785c0..dad832a66 100644 --- a/test/web/mastodon_api/mastodon_api_controller_test.exs +++ b/test/web/mastodon_api/mastodon_api_controller_test.exs @@ -96,6 +96,22 @@ defmodule Pleroma.Web.MastodonAPI.MastodonAPIControllerTest do |> json_response(403) == %{"error" => "This resource requires authentication."} end + test "the public timeline includes only public statuses for an authenticated user" do + user = insert(:user) + + conn = + build_conn() + |> assign(:user, user) + + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "private"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "unlisted"}) + {:ok, _activity} = CommonAPI.post(user, %{"status" => "test", "visibility" => "direct"}) + + res_conn = get(conn, "/api/v1/timelines/public") + assert length(json_response(res_conn, 200)) == 1 + end + describe "posting statuses" do setup do user = insert(:user) |