Add /api/v1/notifications/:id/dismiss endpoint
This commit is contained in:
parent
b87b798ca1
commit
d545b883eb
3 changed files with 22 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue