factory_bot icon indicating copy to clipboard operation
factory_bot copied to clipboard

Support `:traits` option on implicit association

Open r7kamura opened this issue 3 years ago • 0 comments

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]

r7kamura avatar Oct 25 '22 22:10 r7kamura