Autogen Yield liveviews
This commit is contained in:
23
test/support/fixtures/harvest_fixtures.ex
Normal file
23
test/support/fixtures/harvest_fixtures.ex
Normal file
@@ -0,0 +1,23 @@
|
||||
defmodule Osuuspuutarha.HarvestFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Osuuspuutarha.Harvest` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a yield.
|
||||
"""
|
||||
def yield_fixture(attrs \\ %{}) do
|
||||
{:ok, yield} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
amount: "120.5",
|
||||
date: ~D[2023-06-07],
|
||||
plant: :salad,
|
||||
unit: :kg
|
||||
})
|
||||
|> Osuuspuutarha.Harvest.create_yield()
|
||||
|
||||
yield
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user