summaryrefslogtreecommitdiff
path: root/test/unit/conference_test.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:03:10 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:03:10 +0100
commit4e716cea253be9293b247fbe74d25fe288b7853f (patch)
treee7d5ba33b69dfcfbc910d157ca65591a8f022c5b /test/unit/conference_test.rb
parentcac008f58299c443557867588288d7c954026dd2 (diff)
Converted Factory to FactoryGirl.
Diffstat (limited to 'test/unit/conference_test.rb')
-rw-r--r--test/unit/conference_test.rb16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/unit/conference_test.rb b/test/unit/conference_test.rb
index b7cce28..85f7ddb 100644
--- a/test/unit/conference_test.rb
+++ b/test/unit/conference_test.rb
@@ -3,29 +3,29 @@ require 'test_helper'
class ConferenceTest < ActiveSupport::TestCase
def test_should_have_a_valid_factory
- assert Factory.build(:conference).valid?
+ assert FactoryGirl.build(:conference).valid?
end
def test_dates_must_make_sense
# We can't create a conference in the past.
- assert !Factory.build(:conference, :start => Time.now - 1.day, :end => Time.now + 1.day).valid?
+ assert !FactoryGirl.build(:conference, :start => Time.now - 1.day, :end => Time.now + 1.day).valid?
# But we can create a conference which started 2 minutes ago.
- assert Factory.build(:conference, :start => Time.now - 2.minutes, :end => Time.now + 1.hour).valid?
+ assert FactoryGirl.build(:conference, :start => Time.now - 2.minutes, :end => Time.now + 1.hour).valid?
# The end must be before the start.
- assert !Factory.build(:conference, :start => Time.now + 2.day, :end => Time.now + 1.day).valid?
+ assert !FactoryGirl.build(:conference, :start => Time.now + 2.day, :end => Time.now + 1.day).valid?
# No date at all is fine.
- assert Factory.build(:conference, :start => nil, :end => nil).valid?
+ assert FactoryGirl.build(:conference, :start => nil, :end => nil).valid?
# Just start or just end is not ok.
- assert !Factory.build(:conference, :start => nil, :end => Time.now + 1.day).valid?
- assert !Factory.build(:conference, :start => Time.now + 1.day, :end => nil).valid?
+ assert !FactoryGirl.build(:conference, :start => nil, :end => Time.now + 1.day).valid?
+ assert !FactoryGirl.build(:conference, :start => Time.now + 1.day, :end => nil).valid?
end
def test_pin_must_be_nil_or_more_than_6_digits
- conference = Factory.build(:conference, :pin => nil)
+ conference = FactoryGirl.build(:conference, :pin => nil)
assert conference.valid?