tests: add a test to verify the general fake direction protection works in all cases
[akkoma] / test / support / factory.ex
index 6c48d390f04a791b4608cdf87afe269de137c7b8..4f5060abf698a50a1a3bd421180f12aff55ce185 100644 (file)
@@ -92,6 +92,26 @@ defmodule Pleroma.Factory do
     }
   end
 
+  def announce_activity_factory do
+    note_activity = insert(:note_activity)
+    user = insert(:user)
+
+    data = %{
+      "type" => "Announce",
+      "actor" => note_activity.actor,
+      "object" => note_activity.data["id"],
+      "to" => [user.follower_address, note_activity.data["actor"]],
+      "cc" => ["https://www.w3.org/ns/activitystreams#Public"],
+      "context" => note_activity.data["context"]
+    }
+
+    %Pleroma.Activity{
+      data: data,
+      actor: user.ap_id,
+      recipients: data["to"]
+    }
+  end
+
   def like_activity_factory do
     note_activity = insert(:note_activity)
     user = insert(:user)