aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authormarcin mikołajczak <git@mkljczk.pl>2021-11-21 16:53:30 +0100
committermarcin mikołajczak <git@mkljczk.pl>2021-11-21 16:56:26 +0100
commit40414bf177c93b39d75c6091ef0ce1db093edb6f (patch)
tree449c02c847c2385387dc0ee1d1fc58520d6716b1 /test
parentc97f99ccf2a51c7f1078d7a20006deae2df3d12c (diff)
downloadpleroma-40414bf177c93b39d75c6091ef0ce1db093edb6f.tar.gz
MastoAPI: Add user notes on accounts
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/account_controller_test.exs14
-rw-r--r--test/pleroma/web/mastodon_api/views/account_view_test.exs3
2 files changed, 16 insertions, 1 deletions
diff --git a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
index a92a58224..48e658dd2 100644
--- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
@@ -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
diff --git a/test/pleroma/web/mastodon_api/views/account_view_test.exs b/test/pleroma/web/mastodon_api/views/account_view_test.exs
index 60881756d..9fe9d73bc 100644
--- a/test/pleroma/web/mastodon_api/views/account_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs
@@ -271,7 +271,8 @@ defmodule Pleroma.Web.MastodonAPI.AccountViewTest do
requested: false,
domain_blocking: false,
showing_reblogs: true,
- endorsed: false
+ endorsed: false,
+ note: ""
}
test "represent a relationship for the following and followed user" do