MastoAPI: Add user notes on accounts
[akkoma] / test / pleroma / web / mastodon_api / controllers / account_controller_test.exs
index a92a582247ddf252eb83e6c61c9722107f6c870d..48e658dd2f4889317fac246b17bd00215d4dd4dc 100644 (file)
@@ -1776,4 +1776,18 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
 
     assert [%{"id" => ^id2}] = result
   end
+
+  test "create a note on a user" do
+    %{conn: conn} = oauth_access(["write:accounts"])
+    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"
+      })
+
+    assert %{"note" => "Example note"} = json_response_and_validate_schema(ret_conn, 200)
+  end
 end