Files
dinge/test/support/fixtures/ledger_fixtures.ex

26 lines
498 B
Elixir
Raw Normal View History

2024-02-26 14:37:03 +01:00
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