X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Fnotification_test.exs;h=c71df4e07b0afcf32ce3fde5c53fa3ff1096ffb0;hb=426f5ee48a09dbf321c013db08cc849c8929d86d;hp=1c60f6866a1296537e2c7d816bbe328155611082;hpb=509c81e4b10bd8ba6d3a93889cd6fbbbfbcbab21;p=akkoma diff --git a/test/notification_test.exs b/test/notification_test.exs index 1c60f6866..c71df4e07 100644 --- a/test/notification_test.exs +++ b/test/notification_test.exs @@ -662,6 +662,7 @@ defmodule Pleroma.NotificationTest do assert Enum.empty?(Notification.for_user(local_user)) end + @tag capture_log: true 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]) @@ -671,6 +672,18 @@ defmodule Pleroma.NotificationTest do User.follow(follower, old_user) User.follow(other_follower, old_user) + old_user_url = old_user.ap_id + + body = + File.read!("test/fixtures/users_mock/localhost.json") + |> String.replace("{{nickname}}", old_user.nickname) + |> Jason.encode!() + + Tesla.Mock.mock(fn + %{method: :get, url: ^old_user_url} -> + %Tesla.Env{status: 200, body: body} + end) + Pleroma.Web.ActivityPub.ActivityPub.move(old_user, new_user) ObanHelpers.perform_all()