alias Pleroma.Web.ActivityPub.ActivityPub
def build(data \\ %{}, opts \\ %{}) do
- user = opts[:user] || UserBuilder.build
+ user = opts[:user] || Pleroma.Factory.insert(:user)
activity = %{
- "id" => 1,
+ "id" => Pleroma.Web.ActivityPub.Utils.generate_object_id,
"actor" => user.ap_id,
"to" => ["https://www.w3.org/ns/activitystreams#Public"],
"object" => %{
def insert_list(times, data \\ %{}, opts \\ %{}) do
Enum.map(1..times, fn (n) ->
- {:ok, activity} = insert(%{"id" => n})
+ {:ok, activity} = insert(data)
activity
end)
end
def public_and_non_public do
- {:ok, user} = UserBuilder.insert
+ user = Pleroma.Factory.insert(:user)
public = build(%{"id" => 1}, %{user: user})
non_public = build(%{"id" => 2, "to" => []}, %{user: user})