2014-04-30 14:48:20 +02:00
|
|
|
# Read about factories at https://github.com/thoughtbot/factory_girl
|
|
|
|
|
|
2014-04-09 01:32:47 +02:00
|
|
|
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'
|
2014-07-23 09:08:50 +02:00
|
|
|
start_date { Date.today }
|
|
|
|
|
end_date { 6.days.from_now }
|
2016-02-02 00:16:43 +01:00
|
|
|
registration_limit 0
|
2015-10-25 13:29:02 +02:00
|
|
|
|
2015-01-12 23:13:10 +02:00
|
|
|
after(:create) do |conference|
|
|
|
|
|
Role.where(name: 'organizer', resource: conference).first_or_create(description: 'For the organizers of the conference (who shall have full access)')
|
|
|
|
|
Role.where(name: 'cfp', resource: conference).first_or_create(description: 'For the members of the CfP team')
|
|
|
|
|
Role.where(name: 'info_desk', resource: conference).first_or_create(description: 'For the members of the Info Desk team')
|
|
|
|
|
Role.where(name: 'volunteers_coordinator', resource: conference).first_or_create(description: 'For the people in charge of volunteers')
|
|
|
|
|
end
|
|
|
|
|
|
2015-04-14 17:33:59 +02:00
|
|
|
factory :full_conference do
|
|
|
|
|
splashpage
|
|
|
|
|
registration_period
|
|
|
|
|
|
2015-11-07 11:43:36 +02:00
|
|
|
after :create do |conference|
|
|
|
|
|
create(:venue, conference_id: conference.id)
|
|
|
|
|
conference.commercials << create(:conference_commercial, commercialable: conference)
|
|
|
|
|
conference.campaigns << create(:campaign, conference: conference)
|
|
|
|
|
conference.targets << create(:target, conference: conference)
|
|
|
|
|
conference.questions << create(:question, conference_id: conference.id)
|
|
|
|
|
conference.lodgings << create(:lodging, conference: conference)
|
|
|
|
|
conference.sponsors << create(:sponsor, conference: conference)
|
|
|
|
|
conference.sponsorship_levels << create(:sponsorship_level, conference: conference)
|
|
|
|
|
conference.tickets << create(:ticket, conference: conference)
|
2015-04-14 17:33:59 +02:00
|
|
|
end
|
|
|
|
|
end
|
2014-04-09 01:32:47 +02:00
|
|
|
end
|
|
|
|
|
end
|