+ def insert(data \\ %{}, opts \\ %{}) do
+ activity = build(data, opts)
+ ActivityPub.insert(activity)
+ end
+
+ def insert_list(times, data \\ %{}, opts \\ %{}) do
+ Enum.map(1..times, fn (n) ->
+ {:ok, activity} = insert(data)
+ activity
+ end)
+ end
+
+ def public_and_non_public do
+ user = Pleroma.Factory.insert(:user)
+
+ public = build(%{"id" => 1}, %{user: user})
+ non_public = build(%{"id" => 2, "to" => []}, %{user: user})