summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2021-12-25 01:41:12 +0000
committerAlex Gleason <alex@alexgleason.me>2021-12-25 01:41:12 +0000
commit73609211a425922a5068d3912a36b82abe24e12c (patch)
tree1e3fc250ab6cc843d75cb324964c226d0adc183a /test
parentb96a58ff280d57e06505228f9d8a172d47ec8578 (diff)
parent588bcbac55ebbaa1ea68792a1f60aa92c9915f69 (diff)
Merge branch 'account-notes' into 'develop'
MastoAPI: Add user notes on accounts See merge request pleroma/pleroma!3540
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/web/mastodon_api/controllers/account_controller_test.exs17
-rw-r--r--test/pleroma/web/mastodon_api/views/account_view_test.exs3
2 files changed, 19 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 581944b8a..966a4072d 100644
--- a/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/pleroma/web/mastodon_api/controllers/account_controller_test.exs
@@ -1797,4 +1797,21 @@ 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", "read:follows"])
+ other_user = insert(:user)
+
+ conn
+ |> put_req_header("content-type", "application/json")
+ |> post("/api/v1/accounts/#{other_user.id}/note", %{
+ "comment" => "Example note"
+ })
+
+ 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
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 a37169bf9..39b9b0cef 100644
--- a/test/pleroma/web/mastodon_api/views/account_view_test.exs
+++ b/test/pleroma/web/mastodon_api/views/account_view_test.exs
@@ -274,7 +274,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