aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2019-10-08 23:05:57 +0300
committereugenijm <eugenijm@protonmail.com>2019-10-14 02:57:21 +0300
commita97b642289659a5fccb5943c54caa1ecdce5fd2f (patch)
tree02dabe9e66663bfb761543970e0a8a813b08a939 /test/web/mastodon_api/controllers/account_controller_test.exs
parente3b4a3e96b2ffbc6d920155cd41687414045d4d6 (diff)
downloadpleroma-a97b642289659a5fccb5943c54caa1ecdce5fd2f.tar.gz
Mastodon API: Add `exclude_visibilities` parameter to the timeline and notification endpoints
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs14
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