aboutsummaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2020-02-10 07:59:52 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2020-02-10 07:59:52 +0300
commitb87533760bb386e85eb8c806e1d242d2b1380971 (patch)
tree5bdd76fba3da0d90a4c81fff6a930f47b15d4f4c /test/web/mastodon_api/controllers/account_controller_test.exs
parentba5e8a644463a19b863e862def80adb6a5a1060b (diff)
parent544bdbfb90d764a5aba8ed07c13b842838d76d73 (diff)
downloadpleroma-b87533760bb386e85eb8c806e1d242d2b1380971.tar.gz
Merge branch 'develop' into issue/1276
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs11
1 files changed, 11 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 0d4860a42..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)
@@ -668,6 +678,7 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
end
test "rate limit", %{conn: conn} do
+ Pleroma.Config.put([Pleroma.Plugs.RemoteIp, :enabled], true)
app_token = insert(:oauth_token, user: nil)
conn =