Magically summon Ecto fixtures w/ fake data for your tests.
iex> EctoSummoner.summon!(:log)
%Log{log: "log-0"}
iex> EctoSummoner.summon!(:logs)
[%Log{log: "log-9"}, %Log{log: "log-10"}, %Log{log: "log-11"}]
Relationships:
- GameConsole <- one to one -> Warranty
- GameConsole <- one to many -> Peripheral
- RegisteredOwner <- one to many -> GameConsole
- Manufacturer <- one to many -> GameConsoles
- Manufacturer <- many to many -> RegisteredOwner
Command
# This one command generates:
# - 1 GameConsole
# - 2+ Peripherals for the GameConsole
# - 1 Warranty for the GameConsole
# - 1 RegisteredOwner for the GameConsole
# - 1 Manufacturer for the GameConsole,
# 2+ RegisteredOwners for the Manufacturer,
# 2+ Manufacturers for each Registered Owner,
# and 1 GameConsole for each Manufacturer
summon!(
game_console: [
:peripherals,
:warranty,
:registered_owner,
manufacturer: [
registered_owners: [
manufacturers: :game_console
]
]
]
)
If available in Hex, the package can be installed
by adding ecto_summoner
to your list of dependencies in mix.exs
:
def deps do
[
{:ecto_summoner, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/ecto_summoner.