spec/factories.rb in calagator-1.0.0.rc2 vs spec/factories.rb in calagator-1.0.0.rc3
- old
+ new
@@ -17,10 +17,14 @@
sequence(:url) { |n| "http://#{n}.com" }
closed false
wifi true
access_notes "Access permitted."
after(:create) { Sunspot.commit if Calagator::Venue::SearchEngine.kind == :sunspot }
+
+ trait :with_multiple_tags do
+ after(:create) { |venue| venue.update_attributes(tag_list: 'tag1, tag2') }
+ end
end
factory :event, class: Calagator::Event do
sequence(:title) { |n| "Event #{n}" }
sequence(:description) { |n| "Description of Event #{n}." }
@@ -28,9 +32,13 @@
end_time { start_time + 1.hour }
after(:create) { Sunspot.commit if Calagator::Event::SearchEngine.kind == :sunspot }
trait :with_venue do
association :venue
+ end
+
+ trait :with_multiple_tags do
+ after(:create) { |event| event.update_attributes(tag_list: 'tag1, tag2') }
end
end
factory :duplicate_event, parent: :event do
association :duplicate_of, factory: :event