diff options
author | eugenijm <eugenijm@protonmail.com> | 2020-04-27 17:41:38 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-05-02 19:05:13 +0300 |
commit | 66a8e1312dc82fa755a635984f89a5314917d209 (patch) | |
tree | 3fc0c1647d954227604268d7dd94e8cdad16bf3c /test | |
parent | e55876409b523d81bc19db876bc90f29ba80a47c (diff) | |
download | pleroma-66a8e1312dc82fa755a635984f89a5314917d209.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.exs | 8 |
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 c6ccc02c4..bc0c1a791 100644 --- a/test/web/common_api/common_api_test.exs +++ b/test/web/common_api/common_api_test.exs @@ -697,6 +697,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 |