forked from thoughtbot/factory_bot
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow factories with traits to be used in associations
This allows defining associations with factories using traits by slicing up the hash passed to association. Passing an array to `:factory` will use the first item in the array as the factory, with any subsequent symbols as traits. Here's an example: factory :post do association :author, factory: [:user, :admin], name: 'John Doe' end Closes thoughtbot#395
- Loading branch information
1 parent
5e90ff1
commit 4e2b7e0
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters