Update factory.

This commit is contained in:
Roger Braun 2017-04-13 17:05:35 +02:00
parent 653d605e14
commit 834c84b5dc
1 changed files with 18 additions and 0 deletions

View File

@ -34,6 +34,7 @@ def note_activity_factory do
note = insert(:note) note = insert(:note)
data = %{ data = %{
"id" => Pleroma.Web.ActivityPub.ActivityPub.generate_activity_id, "id" => Pleroma.Web.ActivityPub.ActivityPub.generate_activity_id,
"type" => "Create",
"actor" => note.data["actor"], "actor" => note.data["actor"],
"to" => note.data["to"], "to" => note.data["to"],
"object" => note.data, "object" => note.data,
@ -44,4 +45,21 @@ def note_activity_factory do
data: data data: data
} }
end 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 end