summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2019-12-02 16:26:19 +0000
committerlain <lain@soykaf.club>2019-12-02 16:26:19 +0000
commit7722e5a67a46304f3ae0e37f674a44ca9268be5e (patch)
tree504f7b7623c6917fcfa567050d80153e2f2aee11 /test/notification_test.exs
parentd468cba2d56f60a41b0372a381b1017a8d2d046b (diff)
parent1fc28a4b441fdc0de8b2b43e2b045da38ee50b0a (diff)
downloadpleroma-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.exs29
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