aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authoreugenijm <eugenijm@protonmail.com>2020-04-27 17:41:38 +0300
committerrinpatch <rinpatch@sdf.org>2020-05-01 00:39:23 +0300
commit78391a00c579696b1555bbe5373e128b932cfc3f (patch)
tree151a2744db29ccfc44b1f76b8af8714b871b5997 /test
parent61889e00fc4a77e92ed7af3b6a270d10d5b2f34b (diff)
downloadpleroma-78391a00c579696b1555bbe5373e128b932cfc3f.tar.gz
Mastodon API: do not create a following relationship if the corresponding follow request doesn't exist when calling `POST /api/v1/follow_requests/:id/authorize`
Diffstat (limited to 'test')
-rw-r--r--test/web/common_api/common_api_test.exs8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/web/common_api/common_api_test.exs b/test/web/common_api/common_api_test.exs
index b80523160..9b7fce3a0 100644
--- a/test/web/common_api/common_api_test.exs
+++ b/test/web/common_api/common_api_test.exs
@@ -640,6 +640,14 @@ defmodule Pleroma.Web.CommonAPITest do
assert Repo.get(Activity, follow_activity_two.id).data["state"] == "reject"
assert Repo.get(Activity, follow_activity_three.id).data["state"] == "pending"
end
+
+ test "doesn't create a following relationship if the corresponding follow request doesn't exist" do
+ user = insert(:user, locked: true)
+ not_follower = insert(:user)
+ CommonAPI.accept_follow_request(not_follower, user)
+
+ assert Pleroma.FollowingRelationship.following?(not_follower, user) == false
+ end
end
describe "vote/3" do