After 'mix phx.gen.live Items Item items name:string description:string info:string amount:integer factor:float type:string'

This commit is contained in:
2026-04-21 13:29:13 +02:00
parent e930c742b5
commit 851665ef60
10 changed files with 698 additions and 0 deletions

View File

@ -0,0 +1,24 @@
defmodule GenericRestServer.ItemsFixtures do
@moduledoc """
This module defines test helpers for creating
entities via the `GenericRestServer.Items` context.
"""
@doc """
Generate a item.
"""
def item_fixture(scope, attrs \\ %{}) do
attrs =
Enum.into(attrs, %{
amount: 42,
description: "some description",
factor: 120.5,
info: "some info",
name: "some name",
type: "some type"
})
{:ok, item} = GenericRestServer.Items.create_item(scope, attrs)
item
end
end