diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-03-21 17:53:20 +0100 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-03-21 17:53:20 +0100 |
commit | 9a8850eb9ec9eba9350fcb6aadf70fd966623c94 (patch) | |
tree | 12bef929051c5e998107cbae06e6216aa634bf58 /test/support/builders/activity_builder.ex | |
parent | 8de523c8aec19e999334753b5a982fff00d1f44c (diff) | |
download | pleroma-9a8850eb9ec9eba9350fcb6aadf70fd966623c94.tar.gz pleroma-9a8850eb9ec9eba9350fcb6aadf70fd966623c94.zip |
Basic status creation and retrieval.
Diffstat (limited to 'test/support/builders/activity_builder.ex')
-rw-r--r-- | test/support/builders/activity_builder.ex | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/test/support/builders/activity_builder.ex b/test/support/builders/activity_builder.ex new file mode 100644 index 000000000..0b7f79c5f --- /dev/null +++ b/test/support/builders/activity_builder.ex @@ -0,0 +1,37 @@ +defmodule Pleroma.Builders.ActivityBuilder do + alias Pleroma.Builders.UserBuilder + alias Pleroma.Web.ActivityPub.ActivityPub + alias Pleroma.User + + def public_and_non_public do + {:ok, user} = UserBuilder.insert + public = %{ + "id" => 1, + "actor" => user.ap_id, + "to" => ["https://www.w3.org/ns/activitystreams#Public"], + "object" => %{ + "type" => "Note", + "content" => "test" + } + } + + non_public = %{ + "id" => 2, + "actor" => user.ap_id, + "to" => [], + "object" => %{ + "type" => "Note", + "content" => "test" + } + } + + {:ok, public} = ActivityPub.insert(public) + {:ok, non_public} = ActivityPub.insert(non_public) + + %{ + public: public, + non_public: non_public, + user: user + } + end +end |