summaryrefslogtreecommitdiff
path: root/test/web/activity_pub
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2020-02-04 20:35:32 +0400
committerEgor Kislitsyn <egor@kislitsyn.com>2020-02-05 20:22:15 +0400
commit8c71f7e11a377d92234c141ea50170485e773fdc (patch)
tree9fc6579f7a07e92a3bd8dd9d2d6aee1f914fa6c3 /test/web/activity_pub
parentc27d1d65bfd60effdb45359697141c136e156177 (diff)
downloadpleroma-8c71f7e11a377d92234c141ea50170485e773fdc.tar.gz
pleroma-8c71f7e11a377d92234c141ea50170485e773fdc.zip
Add support for cancellation of a follow request
Diffstat (limited to 'test/web/activity_pub')
-rw-r--r--test/web/activity_pub/activity_pub_test.exs17
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 ff4604a52..c8f630266 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