summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-02-07 16:10:43 +0000
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>2020-02-07 16:10:43 +0000
commit1262357ddb4b889337a931a39b3e28bb3d81f944 (patch)
tree44ce7bfc2390694a56c12881de56755d5fd04d0e /test/web/mastodon_api/controllers/account_controller_test.exs
parent8d01aaa7024757f4a64a5e92e84838e35cb0e37e (diff)
parentbc2e98b20099be767a8262b734c6702edea663b4 (diff)
downloadpleroma-1262357ddb4b889337a931a39b3e28bb3d81f944.tar.gz
pleroma-1262357ddb4b889337a931a39b3e28bb3d81f944.zip
Merge branch 'cancel-follow-request' into 'develop'
Add support for cancellation of a follow request Closes #1522 See merge request pleroma/pleroma!2175
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)