osem-fcy/spec/factories/conferences.rb

30 lines
1 KiB
Ruby
Raw Normal View History

2014-04-30 14:48:20 +02:00
# Read about factories at https://github.com/thoughtbot/factory_girl
FactoryGirl.define do
factory :conference do
2014-04-27 17:52:39 +02:00
title 'The dog and pony show'
2014-05-19 12:49:04 +05:30
sequence(:short_title) { |n| "dps#{n}14" }
2014-04-27 17:52:39 +02:00
timezone 'Amsterdam'
start_date { Date.today }
end_date { 6.days.from_now }
program
factory :full_conference do
venue
splashpage
registration_period
after(:build) do |conference|
conference.commercials << build(:conference_commercial, commercialable: conference)
conference.campaigns << build(:campaign, conference: conference)
conference.targets << build(:target, conference: conference)
conference.questions << build(:question, conference_id: conference.id)
conference.lodgings << build(:lodging, conference: conference)
conference.sponsors << build(:sponsor, conference: conference)
conference.sponsorship_levels << build(:sponsorship_level, conference: conference)
conference.tickets << build(:ticket, conference: conference)
end
end
end
end