dings with user assoc

This commit is contained in:
Rüdiger Diedrich
2024-02-26 14:37:03 +01:00
parent c242bbc633
commit 8c46519aaf
13 changed files with 638 additions and 0 deletions

View File

@ -0,0 +1,25 @@
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