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/activity_pub | |
| 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/activity_pub')
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index ea6e79b44..ce68e7d0e 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -1174,6 +1174,23 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert embedded_object["object"] == followed.ap_id assert embedded_object["id"] == follow_activity.data["id"] end + + test "creates an undo activity for a pending follow request" do + follower = insert(:user) + followed = insert(:user, %{locked: true}) + + {:ok, follow_activity} = ActivityPub.follow(follower, followed) + {:ok, activity} = ActivityPub.unfollow(follower, followed) + + assert activity.data["type"] == "Undo" + assert activity.data["actor"] == follower.ap_id + + embedded_object = activity.data["object"] + assert is_map(embedded_object) + assert embedded_object["type"] == "Follow" + assert embedded_object["object"] == followed.ap_id + assert embedded_object["id"] == follow_activity.data["id"] + end end describe "blocking / unblocking" do |
