Sha256: 1d8e54dd1d00d7680854780b383bd4c76d5605b8ffe45c04ab613848c70eaa0f
Contents?: true
Size: 548 Bytes
Versions: 21
Compression:
Stored size: 548 Bytes
Contents
FactoryGirl.define do factory :group do title 'Test Title' transient do owner { User.order("RANDOM()").first } end # the after(:create) yields two values; the user instance itself and the # evaluator, which stores all values from the factory, including transient # attributes; `create_list`'s second argument is the number of records # to create and we make sure the user is associated properly to the post after(:create) do |group, evaluator| evaluator.owner.add_role(:owner, group) end end end
Version data entries
21 entries across 21 versions & 1 rubygems