Make use of fake data in factories

This commit is contained in:
Henne Vogelsang 2016-04-30 17:56:23 +02:00
parent 737a9d4808
commit 77e0340387
30 changed files with 96 additions and 77 deletions

View file

@ -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