-
Passing Additional Arguments to FactoryGirl Factories
I wanted to create a factory that would link various states to my model, but from a specified list instead of automatically generated. I discovered that these are transient attributes: FactoryGirl.define do factory :business do name “MyString” # # # trait :with_states do ignore do state_list [] end # add association equal to state code…