Refactor and add securities controller
This commit is contained in:
25
test/support/fixtures/instruments_fixtures.ex
Normal file
25
test/support/fixtures/instruments_fixtures.ex
Normal file
@@ -0,0 +1,25 @@
|
||||
defmodule Tradex.InstrumentsFixtures do
|
||||
@moduledoc """
|
||||
This module defines test helpers for creating
|
||||
entities via the `Tradex.Instruments` context.
|
||||
"""
|
||||
|
||||
@doc """
|
||||
Generate a security.
|
||||
"""
|
||||
def security_fixture(attrs \\ %{}) do
|
||||
{:ok, security} =
|
||||
attrs
|
||||
|> Enum.into(%{
|
||||
expiration_date: ~D[2025-01-27],
|
||||
isin: "some isin",
|
||||
name: "some name",
|
||||
strike_price: "120.5",
|
||||
ticker: "some ticker",
|
||||
wkn: "some wkn"
|
||||
})
|
||||
|> Tradex.Instruments.create_security()
|
||||
|
||||
security
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user