diff options
author | feld <feld@feld.me> | 2019-10-14 19:40:40 +0000 |
---|---|---|
committer | feld <feld@feld.me> | 2019-10-14 19:40:40 +0000 |
commit | 3b1bc079af8fb6e467a9114de0d32e2de59a7fab (patch) | |
tree | 098012ed8206f9ed41fdf80944f6eaba7f40be40 /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | e0da0d4f9e669b34afe975e39ae21a558bf4c25c (diff) | |
parent | a97b642289659a5fccb5943c54caa1ecdce5fd2f (diff) | |
download | pleroma-3b1bc079af8fb6e467a9114de0d32e2de59a7fab.tar.gz pleroma-3b1bc079af8fb6e467a9114de0d32e2de59a7fab.zip |
Merge branch 'exclude-visibilities-for-timelines' into 'develop'
Mastodon API: Add `exclude_visibilities` parameter to the timeline and notification endpoints
See merge request pleroma/pleroma!1818
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller_test.exs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index 6a59c3d94..745383757 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -237,6 +237,20 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do assert [%{"id" => id}] = json_response(conn, 200) assert id == to_string(post.id) end + + test "the user views their own timelines and excludes direct messages", %{conn: conn} do + user = insert(:user) + {:ok, public_activity} = CommonAPI.post(user, %{"status" => ".", "visibility" => "public"}) + {:ok, _direct_activity} = CommonAPI.post(user, %{"status" => ".", "visibility" => "direct"}) + + conn = + conn + |> assign(:user, user) + |> get("/api/v1/accounts/#{user.id}/statuses", %{"exclude_visibilities" => ["direct"]}) + + assert [%{"id" => id}] = json_response(conn, 200) + assert id == to_string(public_activity.id) + end end describe "followers" do |