diff options
author | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-26 18:48:56 +0700 |
---|---|---|
committer | Egor Kislitsyn <egor@kislitsyn.com> | 2019-11-27 17:52:02 +0700 |
commit | 1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a (patch) | |
tree | d2794209c82c1df497f6926c910fff0d85621317 /test/notification_test.exs | |
parent | 3c0abfca53751624ebd6ea7174ee880d9e7b29e7 (diff) | |
download | pleroma-1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a.tar.gz pleroma-1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a.zip |
Add a view for the move notification
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 |