Update factory.
authorRoger Braun <roger@rogerbraun.net>
Thu, 13 Apr 2017 15:05:35 +0000 (17:05 +0200)
committerRoger Braun <roger@rogerbraun.net>
Thu, 13 Apr 2017 15:05:35 +0000 (17:05 +0200)
test/support/factory.ex

index fcbdfbd9aa472fefd0ce746e03e3a54375d22175..af8e58bd1a6bdf23d39c084a775625c180c97b3f 100644 (file)
@@ -34,6 +34,7 @@ defmodule Pleroma.Factory do
     note = insert(:note)
     data = %{
       "id" => Pleroma.Web.ActivityPub.ActivityPub.generate_activity_id,
+      "type" => "Create",
       "actor" => note.data["actor"],
       "to" => note.data["to"],
       "object" => note.data,
@@ -44,4 +45,21 @@ defmodule Pleroma.Factory do
       data: data
     }
   end
+
+  def like_activity_factory do
+    note_activity = insert(:note_activity)
+    user = insert(:user)
+
+    data = %{
+      "id" => Pleroma.Web.ActivityPub.ActivityPub.generate_activity_id,
+      "actor" => user.ap_id,
+      "type" => "Like",
+      "object" => note_activity.data["object"]["id"],
+      "published_at" => DateTime.utc_now() |> DateTime.to_iso8601
+    }
+
+    %Pleroma.Activity{
+      data: data
+    }
+  end
 end