1
0
Fork 0
LangPlayground/Elixir/notes_app/test/support/fixtures/notes_fixtures.ex
2024-09-05 21:21:36 +02:00

21 lines
405 B
Elixir

defmodule NotesApp.NotesFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `NotesApp.Notes` context.
"""
@doc """
Generate a note.
"""
def note_fixture(attrs \\ %{}) do
{:ok, note} =
attrs
|> Enum.into(%{
content: "some content",
title: "some title"
})
|> NotesApp.Notes.create_note()
note
end
end