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:
24
test/support/fixtures/items_fixtures.ex
Normal file
24
test/support/fixtures/items_fixtures.ex
Normal 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
|
||||
Reference in New Issue
Block a user