Pipeline Ingestion: Note
[akkoma] / test / pleroma / notification_test.exs
index 948587292af35746b5978bf4b30b30224e481607..85f895f0fab7fa8973822d3429c51522c59063ce 100644 (file)
@@ -624,6 +624,8 @@ defmodule Pleroma.NotificationTest do
         "actor" => user.ap_id,
         "object" => %{
           "type" => "Note",
+          "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
+          "to" => ["https://www.w3.org/ns/activitystreams#Public"],
           "content" => "message with a Mention tag, but no explicit tagging",
           "tag" => [
             %{
@@ -655,6 +657,9 @@ defmodule Pleroma.NotificationTest do
         "actor" => user.ap_id,
         "object" => %{
           "type" => "Note",
+          "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(),
+          "to" => ["https://www.w3.org/ns/activitystreams#Public"],
+          "cc" => [other_user.ap_id],
           "content" => "hi everyone",
           "attributedTo" => user.ap_id
         }
@@ -951,6 +956,7 @@ defmodule Pleroma.NotificationTest do
         "cc" => [],
         "object" => %{
           "type" => "Note",
+          "id" => remote_user.ap_id <> "/objects/test",
           "content" => "Hello!",
           "tag" => [
             %{
@@ -990,7 +996,6 @@ 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])
@@ -1000,18 +1005,6 @@ 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()