osem-fcy/spec/factories/conferences.rb

25 lines
759 B
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
social_tag 'dps14'
timezone 'Amsterdam'
2014-05-21 15:42:30 +05:30
description 'Lorem Ipsum dolsum'
2014-04-27 17:52:39 +02:00
contact_email 'admin@example.com'
start_date Date.today
end_date Date.tomorrow
2014-05-21 15:42:30 +05:30
factory :conference_with_registration do
after(:build) do |conference|
create(:participant_role)
create(:admin_role)
user = build(:user)
conference.registrations << build(:registration,
conference: conference,
person: user.person)
end
end
end
end