diff options
author | rinpatch <rinpatch@sdf.org> | 2020-05-22 14:35:13 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-22 14:35:13 +0000 |
commit | 96650c55aec6f6013ca4fbb35b37260f1138c80b (patch) | |
tree | f1c707be3b788a51a726483947dc87a6bb3040b1 /test | |
parent | 7b02bfca51f95f56a5d12724b80b16019507cce9 (diff) | |
parent | ba106aa9c8d4854c2fe0f6bb02091bb3bd6719d7 (diff) | |
download | pleroma-96650c55aec6f6013ca4fbb35b37260f1138c80b.tar.gz pleroma-96650c55aec6f6013ca4fbb35b37260f1138c80b.zip |
Merge branch 'fix/notifications-api' into 'develop'
Fix notifications mark as read API
Closes #1800
See merge request pleroma/pleroma!2570
Diffstat (limited to 'test')
-rw-r--r-- | test/web/pleroma_api/controllers/notification_controller_test.exs | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/test/web/pleroma_api/controllers/notification_controller_test.exs b/test/web/pleroma_api/controllers/notification_controller_test.exs index 7c5ace804..bb4fe6c49 100644 --- a/test/web/pleroma_api/controllers/notification_controller_test.exs +++ b/test/web/pleroma_api/controllers/notification_controller_test.exs @@ -23,7 +23,8 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do response = conn - |> post("/api/v1/pleroma/notifications/read?id=#{notification1.id}") + |> put_req_header("content-type", "application/json") + |> post("/api/v1/pleroma/notifications/read", %{id: notification1.id}) |> json_response_and_validate_schema(:ok) assert %{"pleroma" => %{"is_seen" => true}} = response @@ -41,7 +42,8 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do [response1, response2] = conn - |> post("/api/v1/pleroma/notifications/read?max_id=#{notification2.id}") + |> put_req_header("content-type", "application/json") + |> post("/api/v1/pleroma/notifications/read", %{max_id: notification2.id}) |> json_response_and_validate_schema(:ok) assert %{"pleroma" => %{"is_seen" => true}} = response1 @@ -54,7 +56,10 @@ defmodule Pleroma.Web.PleromaAPI.NotificationControllerTest do test "it returns error when notification not found", %{conn: conn} do response = conn - |> post("/api/v1/pleroma/notifications/read?id=22222222222222") + |> put_req_header("content-type", "application/json") + |> post("/api/v1/pleroma/notifications/read", %{ + id: 22_222_222_222_222 + }) |> json_response_and_validate_schema(:bad_request) assert response == %{"error" => "Cannot get notification"} |