aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-06-02 14:05:53 +0200
committerlain <lain@soykaf.club>2020-06-02 14:05:53 +0200
commit127ccc4e1c76c2782b26a0cfbb154bc1317f31b3 (patch)
tree8c7367ad3a8c345d03b499f38a4883cc53f569e1 /test/web/mastodon_api
parent805ab86933d90d4284c83e4a8ebfd6bf4b0395b3 (diff)
downloadpleroma-127ccc4e1c76c2782b26a0cfbb154bc1317f31b3.tar.gz
NotificationController: Don't return chat_mentions by default.
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index e278d61f5..698c99711 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -54,6 +54,27 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert response == expected_response
end
+ test "by default, does not contain pleroma:chat_mention" do
+ %{user: user, conn: conn} = oauth_access(["read:notifications"])
+ other_user = insert(:user)
+
+ {:ok, _activity} = CommonAPI.post_chat_message(other_user, user, "hey")
+
+ result =
+ conn
+ |> get("/api/v1/notifications")
+ |> json_response_and_validate_schema(200)
+
+ assert [] == result
+
+ result =
+ conn
+ |> get("/api/v1/notifications?include_types[]=pleroma:chat_mention")
+ |> json_response_and_validate_schema(200)
+
+ assert [_] = result
+ end
+
test "getting a single notification" do
%{user: user, conn: conn} = oauth_access(["read:notifications"])
other_user = insert(:user)