diff options
author | rinpatch <rinpatch@sdf.org> | 2019-01-18 18:31:25 +0300 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2019-01-18 18:31:25 +0300 |
commit | 74346a7035d950ede143d65f8364194cb116aaf5 (patch) | |
tree | f058b3fc2edd6868511bc6f832f75374bdbd117e /test/support | |
parent | a38f21f51dc810221cbf910556910a10f6104956 (diff) | |
parent | 98d9dcd509ab6823e38b3ddbce1f5fc4f3d5a82c (diff) | |
download | pleroma-74346a7035d950ede143d65f8364194cb116aaf5.tar.gz |
Fix merge conflict
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/factory.ex | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/test/support/factory.ex b/test/support/factory.ex index 57fa4a79d..4ac77981a 100644 --- a/test/support/factory.ex +++ b/test/support/factory.ex @@ -57,6 +57,11 @@ defmodule Pleroma.Factory do %Pleroma.Object{data: Map.merge(data, %{"to" => [user2.ap_id]})} end + def article_factory do + note_factory() + |> Map.put("type", "Article") + end + def tombstone_factory do data = %{ "type" => "Tombstone", @@ -110,6 +115,26 @@ defmodule Pleroma.Factory do } end + def article_activity_factory do + article = insert(:article) + + data = %{ + "id" => Pleroma.Web.ActivityPub.Utils.generate_activity_id(), + "type" => "Create", + "actor" => article.data["actor"], + "to" => article.data["to"], + "object" => article.data, + "published" => DateTime.utc_now() |> DateTime.to_iso8601(), + "context" => article.data["context"] + } + + %Pleroma.Activity{ + data: data, + actor: data["actor"], + recipients: data["to"] + } + end + def announce_activity_factory do note_activity = insert(:note_activity) user = insert(:user) |