summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-10-01 17:15:58 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-10-02 21:22:21 +0700
commit7f2bc577250ccea26c133502787d0bbdcbc839ee (patch)
tree1163663662da48b081703434c3d031351b0851bb /test/web/mastodon_api/controllers/account_controller_test.exs
parentc5e937b156ea1f8f96ade7d9104fc2c5fd1dd9cd (diff)
downloadpleroma-7f2bc577250ccea26c133502787d0bbdcbc839ee.tar.gz
pleroma-7f2bc577250ccea26c133502787d0bbdcbc839ee.zip
Move `follows`, `mutes` and `blocks` actions to AccountController
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