Packages

An Elixir Ecto Package to Boost Your Productivity and Achieve 90% throughput in Just 10% of the Time.

Current section

Files

Jump to
ecto_entity test support factory.ex
Raw

test/support/factory.ex

defmodule Factory do
defmacro __using__(_) do
quote do
# TEST HELPER FUNCTIONS
def person_attrs do
%{
first_name: Faker.first_name(),
last_name: Faker.last_name(),
age: Faker.random_digit()
}
end
def seed_people(count \\ 1) do
1..count
|> Enum.map(fn _ -> Person.insert(person_attrs()) end)
end
end
end
end