summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorkaniini <ariadne@dereferenced.org>2019-10-05 19:28:53 +0000
committerkaniini <ariadne@dereferenced.org>2019-10-05 19:28:53 +0000
commit7a318d74e64fd0df9b3be202810dee2119862aba (patch)
tree150951d58d24ad7d510ca12ccc1b34545f1f5bac /test/web/mastodon_api/controllers/account_controller_test.exs
parent45b7f03f89ac4ef308720dc7f6d1230c63a6e197 (diff)
parente0c68eeb024c7d91b098c4e0eb6ad57551ea9ef1 (diff)
downloadpleroma-7a318d74e64fd0df9b3be202810dee2119862aba.tar.gz
pleroma-7a318d74e64fd0df9b3be202810dee2119862aba.zip
Merge branch 'split-masto-api/leftovers' into 'develop'
[#1278] Move a few more actions from MastodonAPIController See merge request pleroma/pleroma!1761
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