33 lines
733 B
Elixir
33 lines
733 B
Elixir
defmodule Nulla.NotesFixtures do
|
|
import Nulla.ActorsFixtures
|
|
|
|
@moduledoc """
|
|
This module defines test helpers for creating
|
|
entities via the `Nulla.Notes` context.
|
|
"""
|
|
|
|
@doc """
|
|
Generate a note.
|
|
"""
|
|
def note_fixture(attrs \\ %{}) do
|
|
actor = actor_fixture()
|
|
|
|
{:ok, note} =
|
|
attrs
|
|
|> Enum.into(%{
|
|
cc: ["option1", "option2"],
|
|
content: "some content",
|
|
inReplyTo: "some inReplyTo",
|
|
language: "some language",
|
|
published: ~U[2025-07-01 09:17:00Z],
|
|
sensitive: true,
|
|
to: ["option1", "option2"],
|
|
url: "some url",
|
|
visibility: "some visibility",
|
|
actor_id: actor.id
|
|
})
|
|
|> Nulla.Notes.create_note()
|
|
|
|
note
|
|
end
|
|
end
|