diff options
author | lain <lain@soykaf.club> | 2019-12-02 16:26:19 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-12-02 16:26:19 +0000 |
commit | 7722e5a67a46304f3ae0e37f674a44ca9268be5e (patch) | |
tree | 504f7b7623c6917fcfa567050d80153e2f2aee11 /test/notification_test.exs | |
parent | d468cba2d56f60a41b0372a381b1017a8d2d046b (diff) | |
parent | 1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a (diff) | |
download | pleroma-7722e5a67a46304f3ae0e37f674a44ca9268be5e.tar.gz pleroma-7722e5a67a46304f3ae0e37f674a44ca9268be5e.zip |
Merge branch 'feature/move-activity' into 'develop'
Support "Move" activity
Closes #1316
See merge request pleroma/pleroma!1883
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r-- | test/notification_test.exs | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs index f8d429223..dcbffeafe 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -630,6 +630,35 @@ defmodule Pleroma.NotificationTest do assert Enum.empty?(Notification.for_user(local_user)) end + + test "move activity generates a notification" do + %{ap_id: old_ap_id} = old_user = insert(:user) + %{ap_id: new_ap_id} = new_user = insert(:user, also_known_as: [old_ap_id]) + follower = insert(:user) + other_follower = insert(:user, %{allow_following_move: false}) + + User.follow(follower, old_user) + User.follow(other_follower, old_user) + + Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user) + ObanHelpers.perform_all() + + assert [ + %{ + activity: %{ + data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id} + } + } + ] = Notification.for_user(follower) + + assert [ + %{ + activity: %{ + data: %{"type" => "Move", "actor" => ^old_ap_id, "target" => ^new_ap_id} + } + } + ] = Notification.for_user(other_follower) + end end describe "for_user" do |