summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-10-06 08:11:47 +0000
committerlain <lain@soykaf.club>2019-10-06 08:11:47 +0000
commit61097ba6ab1f40f8a885f1adc96455b3c82cfd9b (patch)
tree4ead08dab6a485b3020fb9f30663e4b4466698ae /test/web/mastodon_api/controllers/account_controller_test.exs
parent1ed8fbc4d96c1d44ab968d6aa1b0069c55e44626 (diff)
parent9e34919dcdbeedf8eb623dc86b05f63ef44d8859 (diff)
downloadpleroma-61097ba6ab1f40f8a885f1adc96455b3c82cfd9b.tar.gz
pleroma-61097ba6ab1f40f8a885f1adc96455b3c82cfd9b.zip
Merge branch 'develop' into 'reactions'
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs30
1 files changed, 30 insertions, 0 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs
index 8c8017838..6a59c3d94 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -849,4 +849,34 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
assert [] = json_response(conn, 200)
end
end
+
+ test "getting a list of mutes", %{conn: conn} do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, user} = User.mute(user, other_user)
+
+ conn =
+ conn
+ |> assign(:user, user)
+ |> get("/api/v1/mutes")
+
+ other_user_id = to_string(other_user.id)
+ assert [%{"id" => ^other_user_id}] = json_response(conn, 200)
+ end
+
+ test "getting a list of blocks", %{conn: conn} do
+ user = insert(:user)
+ other_user = insert(:user)
+
+ {:ok, user} = User.block(user, other_user)
+
+ conn =
+ conn
+ |> assign(:user, user)
+ |> get("/api/v1/blocks")
+
+ other_user_id = to_string(other_user.id)
+ assert [%{"id" => ^other_user_id}] = json_response(conn, 200)
+ end
end