summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorfeld <feld@feld.me>2020-04-09 19:32:11 +0000
committerfeld <feld@feld.me>2020-04-09 19:32:11 +0000
commitc23532d24bc47b5cc11004ea80b206c092850c3c (patch)
tree5c7c7f94208d0e6c2d1aefd63b92aa132997f853 /test
parente84c0450bff0f6f34f24fc66a73e6778c0d00617 (diff)
parentd545b883eb3c5b79b89a49ccaf9256c31b401145 (diff)
downloadpleroma-c23532d24bc47b5cc11004ea80b206c092850c3c.tar.gz
pleroma-c23532d24bc47b5cc11004ea80b206c092850c3c.zip
Merge branch 'notifications-dismiss-api' into 'develop'
Add `/api/v1/notifications/:id/dismiss` endpoint Closes #1673 See merge request pleroma/pleroma!2360
Diffstat (limited to 'test')
-rw-r--r--test/web/mastodon_api/controllers/notification_controller_test.exs18
1 files changed, 17 insertions, 1 deletions
diff --git a/test/web/mastodon_api/controllers/notification_controller_test.exs b/test/web/mastodon_api/controllers/notification_controller_test.exs
index 6f1fab069..1557937d8 100644
--- a/test/web/mastodon_api/controllers/notification_controller_test.exs
+++ b/test/web/mastodon_api/controllers/notification_controller_test.exs
@@ -53,7 +53,7 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert response == expected_response
end
- test "dismissing a single notification" do
+ test "dismissing a single notification (deprecated endpoint)" do
%{user: user, conn: conn} = oauth_access(["write:notifications"])
other_user = insert(:user)
@@ -69,6 +69,22 @@ defmodule Pleroma.Web.MastodonAPI.NotificationControllerTest do
assert %{} = json_response(conn, 200)
end
+ test "dismissing a single notification" do
+ %{user: user, conn: conn} = oauth_access(["write:notifications"])
+ other_user = insert(:user)
+
+ {:ok, activity} = CommonAPI.post(other_user, %{"status" => "hi @#{user.nickname}"})
+
+ {:ok, [notification]} = Notification.create_notifications(activity)
+
+ conn =
+ conn
+ |> assign(:user, user)
+ |> post("/api/v1/notifications/#{notification.id}/dismiss")
+
+ assert %{} = json_response(conn, 200)
+ end
+
test "clearing all notifications" do
%{user: user, conn: conn} = oauth_access(["write:notifications", "read:notifications"])
other_user = insert(:user)