exmr/test/support/fixtures/exams_fixtures.ex

23 lines
435 B
Elixir
Raw Normal View History

2024-11-14 23:33:29 +02:00
defmodule Exmr.ExamsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `Exmr.Exams` context.
"""
@doc """
Generate a exam.
"""
def exam_fixture(attrs \\ %{}) do
{:ok, exam} =
attrs
|> Enum.into(%{
date: ~D[2024-11-13],
description: "some description",
subject: "some subject"
})
|> Exmr.Exams.create_exam()
exam
end
end