diff options
author | eugenijm <eugenijm@protonmail.com> | 2019-09-20 17:54:38 +0300 |
---|---|---|
committer | Ariadne Conill <ariadne@dereferenced.org> | 2019-10-07 11:28:51 +0000 |
commit | 790ae8e18963487f6e63fbd12407acd9a0ef1c76 (patch) | |
tree | 5a9c3f753fc7604368039ea2f446d2f969f50ee8 /test | |
parent | f6ff19e0745a2362406ea2b073e7ca85f2121d41 (diff) | |
download | pleroma-790ae8e18963487f6e63fbd12407acd9a0ef1c76.tar.gz pleroma-790ae8e18963487f6e63fbd12407acd9a0ef1c76.zip |
Mastodon API: Fix private and direct statuses not being filtered out from the public timeline for an authenticated user (`GET /api/v1/timelines/public`)
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) |