diff options
author | lain <lain@soykaf.club> | 2018-03-30 15:01:53 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2018-03-30 15:01:53 +0200 |
commit | 4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785 (patch) | |
tree | 6959e12d9058c981f3b69c77b8b0290049651cd6 /test/support/builders | |
parent | 480932c8e524e1a80c9c8ef1a1aa23379f633afe (diff) | |
download | pleroma-4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785.tar.gz pleroma-4afbef39f49948ddd3b1cd1bbda58ff7e3ac2785.zip |
Format the code.
Diffstat (limited to 'test/support/builders')
-rw-r--r-- | test/support/builders/activity_builder.ex | 8 | ||||
-rw-r--r-- | test/support/builders/user_builder.ex | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/test/support/builders/activity_builder.ex b/test/support/builders/activity_builder.ex index 0ebf633b3..d9c188955 100644 --- a/test/support/builders/activity_builder.ex +++ b/test/support/builders/activity_builder.ex @@ -4,17 +4,19 @@ defmodule Pleroma.Builders.ActivityBuilder do def build(data \\ %{}, opts \\ %{}) do user = opts[:user] || Pleroma.Factory.insert(:user) + activity = %{ - "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id, + "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id(), "actor" => user.ap_id, "to" => ["https://www.w3.org/ns/activitystreams#Public"], "type" => "Create", "object" => %{ "type" => "Note", "content" => "test", - "to" => ["https://www.w3.org/ns/activitystreams#Public"], + "to" => ["https://www.w3.org/ns/activitystreams#Public"] } } + Map.merge(activity, data) end @@ -24,7 +26,7 @@ defmodule Pleroma.Builders.ActivityBuilder do end def insert_list(times, data \\ %{}, opts \\ %{}) do - Enum.map(1..times, fn (n) -> + Enum.map(1..times, fn n -> {:ok, activity} = insert(data, opts) activity end) diff --git a/test/support/builders/user_builder.ex b/test/support/builders/user_builder.ex index 1e1e80ac9..7a1ca79b5 100644 --- a/test/support/builders/user_builder.ex +++ b/test/support/builders/user_builder.ex @@ -10,6 +10,7 @@ defmodule Pleroma.Builders.UserBuilder do bio: "A tester.", ap_id: "some id" } + Map.merge(user, data) end |