- 👍 Allows more control over factory definitions ([#333])
- ➕ Adds ability to reset specific sequences ([#331])
- ➕ Adds additional callbacks for functions with default params ([#319])
- 👌 Support bare maps in embeds https://github.com/thoughtbot/ex_machina/commit/efd4e7c6125843d20b8dd07d91ded6240ecaf5ef
- Handle nested structures in
- Handle the number
- 📚 Miscellaneous documentation improvements.
- Cast all values before insert (#149)
For example, this means that if you have
field :equity, :decimalin your schema, you can set the value to
0in your factory and it will automatically cast the value to a Decimal.
string_params_for, which is useful for controller specs. (#168)
- ➕ Add
Sequence.reset/0for resetting sequences between tests. (#151)
params_*functions now drop fields with
- Don't delete
📚 Minor documentation fixes
⬆️ A lot has changed but we tried to make upgrading as simple as possible.
⬆️ To upgrade: In
mix.exschange the version to
"~> 1.0"and run
mix ⚡️ deps.get. Once you've updated, run
mix testand ExMachina will raise errors that show you what needs to change to work with 1.0.0.
- ➕ Add
Sequence.next/1for quickly creating sequences. Example:
- Raise if passing invalid keys to structs (#99)
- If using ExMachina with Ecto, use
- Instead of defining a custom
save_record, you can now implement an
ExMachina.Strategy. See the documentation on hex.pm for more info (#102)
- 👀 Define factory as
factory(:user)(#110). See PR and related issue for details on why this was changed.
params_forno longer returns the primary key (#123)
- ➕ Add