summaryrefslogtreecommitdiff
path: root/test/notification_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2019-12-06 00:26:31 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2019-12-06 00:26:31 +0300
commit13926537b644c3a4f1904c2fcd5d25fe0f284663 (patch)
tree713182a80672ab37ad9284ad82b399107f050208 /test/notification_test.exs
parentaf42c00cfffb2cd8e93857cd1cf2901113c45bd2 (diff)
parent228bf4d214abe3bb62c52128d3bc145e396b174d (diff)
downloadpleroma-13926537b644c3a4f1904c2fcd5d25fe0f284663.tar.gz
pleroma-13926537b644c3a4f1904c2fcd5d25fe0f284663.zip
Merge remote-tracking branch 'remotes/origin/develop' into 1427-oauth-admin-scopes
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