summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorMaksim Pechnikov <parallel588@gmail.com>2019-12-05 15:46:27 +0300
committerMaksim Pechnikov <parallel588@gmail.com>2019-12-05 15:46:27 +0300
commit3fe7a1fd35a9ca81b158eff6dbcc25ca48cbf96d (patch)
tree9a275a71ab8eeb19ce1e02d0b6ba64fe309f3d79 /test/notification_test.exs
parenta36607c27e6a50aeca450570f7b8e4c9c0233bb1 (diff)
parent228bf4d214abe3bb62c52128d3bc145e396b174d (diff)
downloadpleroma-3fe7a1fd35a9ca81b158eff6dbcc25ca48cbf96d.tar.gz
pleroma-3fe7a1fd35a9ca81b158eff6dbcc25ca48cbf96d.zip
Merge branch 'develop' into issue/1342
Diffstat (limited to 'test/notification_test.exs')
-rw-r--r--test/notification_test.exs29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/notification_test.exs b/test/notification_test.exs
index e7c031c8f..730d87d91 100644
--- a/test/notification_test.exs
+++ b/test/notification_test.exs
@@ -642,6 +642,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