factory_bot
factory_bot copied to clipboard
Support `:traits` option on implicit association
If we want to specify traits in implicit associations, we have to use :factory option. This is not only a naming problem, but also redundant in implicit style, because when using :factory option, the main factory name must always be specified, so the same name must be written twice.
user factory: [:user, :trait1, :trait2]
# ^^^^ ^^^^
To resolve this problem, I propose to allow :traits option on implicit associations in this Pull Request.
user traits: [:trait1, :trait2]