Sha256: 73aa5a0914e472644e99caed6a532522b6e6591a7ed4e71d97927c80fd5e557c
Contents?: true
Size: 548 Bytes
Versions: 16
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
16 entries across 16 versions & 1 rubygems