This commit is contained in:
Mirai Kumiko 2025-07-04 10:25:40 +02:00
parent b35e18cd20
commit 82f55f7afe
Signed by: miraikumiko
GPG key ID: 3F178B1B5E0CB278
80 changed files with 6687 additions and 5 deletions

View 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