summaryrefslogtreecommitdiff
path: root/test/web/activity_pub
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-02-11 13:58:36 +0100
committerlain <lain@soykaf.club>2020-02-11 13:58:36 +0100
commit24c526a0b18b822ae339a481934bfa66b13bba54 (patch)
tree11d7c9bb2bf5503b536ee0ab72533974e9a7b21b /test/web/activity_pub
parent57098713c02363aaee78d519726e6f2975f725d8 (diff)
parent2f1c61255ff95a1d21a751cb78da3c031ccdd692 (diff)
downloadpleroma-24c526a0b18b822ae339a481934bfa66b13bba54.tar.gz
pleroma-24c526a0b18b822ae339a481934bfa66b13bba54.zip
Merge remote-tracking branch 'origin/develop' into uguu-uwu-notices-bulge
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 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