Update test
authormarcin mikołajczak <git@mkljczk.pl>
Sun, 21 Nov 2021 16:50:42 +0000 (17:50 +0100)
committermarcin mikołajczak <git@mkljczk.pl>
Sun, 21 Nov 2021 16:51:00 +0000 (17:51 +0100)
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
test/pleroma/web/mastodon_api/controllers/account_controller_test.exs

index 48e658dd2f4889317fac246b17bd00215d4dd4dc..4f855ac5c696ef07ca3754e1ab04491c1c09b70b 100644 (file)
@@ -1778,16 +1778,19 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
   end
 
   test "create a note on a user" do
-    %{conn: conn} = oauth_access(["write:accounts"])
+    %{conn: conn} = oauth_access(["write:accounts", "read:follows"])
     other_user = insert(:user)
 
-    ret_conn =
-      conn
-      |> put_req_header("content-type", "application/json")
-      |> post("/api/v1/accounts/#{other_user.id}/note", %{
-        "comment" => "Example note"
-      })
+    conn
+    |> put_req_header("content-type", "application/json")
+    |> post("/api/v1/accounts/#{other_user.id}/note", %{
+      "comment" => "Example note"
+    })
 
-    assert %{"note" => "Example note"} = json_response_and_validate_schema(ret_conn, 200)
+    assert [%{"note" => "Example note"}] =
+             conn
+             |> put_req_header("content-type", "application/json")
+             |> get("/api/v1/accounts/relationships?id=#{other_user.id}")
+             |> json_response_and_validate_schema(200)
   end
 end