diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-02-07 16:10:43 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-02-07 16:10:43 +0000 |
commit | 1262357ddb4b889337a931a39b3e28bb3d81f944 (patch) | |
tree | 44ce7bfc2390694a56c12881de56755d5fd04d0e /test/web/mastodon_api/controllers/account_controller_test.exs | |
parent | 8d01aaa7024757f4a64a5e92e84838e35cb0e37e (diff) | |
parent | bc2e98b20099be767a8262b734c6702edea663b4 (diff) | |
download | pleroma-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.exs | 10 |
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) |