From 834c84b5dc5821d04f5a24b1202c6bbf9f32094f Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Thu, 13 Apr 2017 17:05:35 +0200 Subject: [PATCH] Update factory. --- test/support/factory.ex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/test/support/factory.ex b/test/support/factory.ex index fcbdfbd9a..af8e58bd1 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -34,6 +34,7 @@ def note_activity_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 @@ def note_activity_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