diff options
| author | Maksim Pechnikov <parallel588@gmail.com> | 2020-02-10 20:49:20 +0300 |
|---|---|---|
| committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-02-10 20:49:20 +0300 |
| commit | 6813c0302c2b665d337d5f5831d2df6312b6b277 (patch) | |
| tree | 8c9333eeff70c799ecd30e6589f3cbebd8adbf5c /test/web/activity_pub/activity_pub_test.exs | |
| parent | 2c40c8b4a2890e60abe8d67a3c8af4a88d225b60 (diff) | |
| parent | 544bdbfb90d764a5aba8ed07c13b842838d76d73 (diff) | |
| download | pleroma-6813c0302c2b665d337d5f5831d2df6312b6b277.tar.gz pleroma-6813c0302c2b665d337d5f5831d2df6312b6b277.zip | |
Merge branch 'develop' into issue/1383
Diffstat (limited to 'test/web/activity_pub/activity_pub_test.exs')
| -rw-r--r-- | test/web/activity_pub/activity_pub_test.exs | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/test/web/activity_pub/activity_pub_test.exs b/test/web/activity_pub/activity_pub_test.exs index ff4604a52..ce68e7d0e 100644 --- a/test/web/activity_pub/activity_pub_test.exs +++ b/test/web/activity_pub/activity_pub_test.exs @@ -877,7 +877,7 @@ defmodule Pleroma.Web.ActivityPub.ActivityPubTest do assert reaction_activity assert reaction_activity.data["actor"] == reactor.ap_id - assert reaction_activity.data["type"] == "EmojiReaction" + assert reaction_activity.data["type"] == "EmojiReact" assert reaction_activity.data["content"] == "🔥" assert reaction_activity.data["object"] == object.data["id"] assert reaction_activity.data["to"] == [User.ap_followers(reactor), activity.data["actor"]] @@ -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 |
