summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-02-04 20:35:32 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-02-05 20:22:15 +0400
commit8c71f7e11a377d92234c141ea50170485e773fdc (patch)
tree9fc6579f7a07e92a3bd8dd9d2d6aee1f914fa6c3 /test/web/mastodon_api/controllers/account_controller_test.exs
parentc27d1d65bfd60effdb45359697141c136e156177 (diff)
downloadpleroma-8c71f7e11a377d92234c141ea50170485e773fdc.tar.gz
pleroma-8c71f7e11a377d92234c141ea50170485e773fdc.zip
Add support for cancellation of a follow request
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs10
1 files changed, 10 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 ec1e18002..e2abcd7c5 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -457,6 +457,16 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
assert id == to_string(other_user.id)
end
+ test "cancelling follow request", %{conn: conn} do
+ %{id: other_user_id} = insert(:user, %{locked: true})
+
+ assert %{"id" => ^other_user_id, "following" => false, "requested" => true} =
+ conn |> post("/api/v1/accounts/#{other_user_id}/follow") |> json_response(:ok)
+
+ assert %{"id" => ^other_user_id, "following" => false, "requested" => false} =
+ conn |> post("/api/v1/accounts/#{other_user_id}/unfollow") |> json_response(:ok)
+ end
+
test "following without reblogs" do
%{conn: conn} = oauth_access(["follow", "read:statuses"])
followed = insert(:user)