summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/notification_controller_test.exs
diff options
context:
space:
mode:
authorrinpatch <rinpatch@sdf.org>2020-06-10 12:05:45 +0000
committerrinpatch <rinpatch@sdf.org>2020-06-10 12:05:45 +0000
commit7aa6c82937090ca6f2298dee0ef894954ca2f129 (patch)
tree850f22f06eccd0babae8b805fa55109b536f324c /test/web/mastodon_api/controllers/notification_controller_test.exs
parent1b746cfbbb55cd3411e809ead246c752a43361d0 (diff)
parent064c4f86f32b626a626fbc238f09434617f57a90 (diff)
downloadpleroma-7aa6c82937090ca6f2298dee0ef894954ca2f129.tar.gz
pleroma-7aa6c82937090ca6f2298dee0ef894954ca2f129.zip
Merge branch 'remake-remodel-dms' into 'develop'
Chats / ChatMessages See merge request pleroma/pleroma!2429
Diffstat (limited to 'test/web/mastodon_api/controllers/notification_controller_test.exs')
-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)