Make use of fake data in factories
This commit is contained in:
parent
737a9d4808
commit
77e0340387
30 changed files with 96 additions and 77 deletions
|
|
@ -2,11 +2,9 @@
|
|||
|
||||
FactoryGirl.define do
|
||||
factory :question do
|
||||
title 'blah'
|
||||
title { Faker::Lorem.sentence }
|
||||
question_type
|
||||
after(:build) do |question|
|
||||
question.answers << build(:answer)
|
||||
question.conferences << build(:conference)
|
||||
end
|
||||
conferences { [create(:conference)] }
|
||||
answers { [create(:answer) ] }
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue