Add all
This commit is contained in:
parent
b35e18cd20
commit
82f55f7afe
80 changed files with 6687 additions and 5 deletions
38
test/support/fixtures/relations_fixtures.ex
Normal file
38
test/support/fixtures/relations_fixtures.ex
Normal file
|
@ -0,0 +1,38 @@
|
|||
defmodule Nulla.RelationsFixtures do
|
||||
import Nulla.ActorsFixtures
|
||||
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Nulla.Relations` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a relation.
|
||||
"""
|
||||
def relation_fixture(attrs \\ %{}) do
|
||||
local_actor = actor_fixture()
|
||||
remote_actor = actor_fixture()
|
||||
|
||||
{:ok, relation} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
blocked_by: true,
|
||||
blocking: true,
|
||||
domain_blocking: true,
|
||||
followed_by: true,
|
||||
following: true,
|
||||
muting: true,
|
||||
muting_notifications: true,
|
||||
note: "some note",
|
||||
notifying: true,
|
||||
requested: true,
|
||||
showing_replies: true,
|
||||
showings_reblogs: true,
|
||||
local_actor_id: local_actor.id,
|
||||
remote_actor_id: remote_actor.id
|
||||
})
|
||||
|> Nulla.Relations.create_relation()
|
||||
|
||||
relation
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue