nulla/test/support/fixtures/announces_fixtures.ex
2025-07-06 14:46:08 +02:00

24 lines
511 B
Elixir

defmodule Nulla.AnnouncesFixtures do
import Nulla.ActorsFixtures
import Nulla.NotesFixtures
@moduledoc """
This module defines test helpers for creating
entities via the `Nulla.Announces` context.
"""
@doc """
Generate a announce.
"""
def announce_fixture(attrs \\ %{}) do
actor = actor_fixture()
note = note_fixture()
{:ok, announce} =
attrs
|> Enum.into(%{actor_id: actor.id, note_id: note.id})
|> Nulla.Announces.create_announce()
announce
end
end