X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fweb%2Fpleroma_api%2Fcontrollers%2Fnotification_controller_test.exs;h=bb4fe6c4992d9f93ec78eb6fe46dfc52e8666e82;hb=9c672ecbb5d4477cd16d2139a2cb66d3923ac5c8;hp=7c5ace804d7e16e6bb946a5028d60047a740dbe2;hpb=7b02bfca51f95f56a5d12724b80b16019507cce9;p=akkoma 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"}