26 lines
498 B
Elixir
26 lines
498 B
Elixir
![]() |
defmodule Dinge.LedgerFixtures do
|
||
|
@moduledoc """
|
||
|
This module defines test helpers for creating
|
||
|
entities via the `Dinge.Ledger` context.
|
||
|
"""
|
||
|
|
||
|
@doc """
|
||
|
Generate a ding.
|
||
|
"""
|
||
|
def ding_fixture(attrs \\ %{}) do
|
||
|
{:ok, ding} =
|
||
|
attrs
|
||
|
|> Enum.into(%{
|
||
|
count: 42,
|
||
|
ding_type: :countdown,
|
||
|
status: :active,
|
||
|
target_count: 42,
|
||
|
target_type: :default,
|
||
|
title: "some title"
|
||
|
})
|
||
|
|> Dinge.Ledger.create_ding()
|
||
|
|
||
|
ding
|
||
|
end
|
||
|
end
|