summaryrefslogtreecommitdiff
path: root/test/unit/tenant_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/tenant_test.rb
parentcac008f58299c443557867588288d7c954026dd2 (diff)
Converted Factory to FactoryGirl.
Diffstat (limited to 'test/unit/tenant_test.rb')
-rw-r--r--test/unit/tenant_test.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/unit/tenant_test.rb b/test/unit/tenant_test.rb
index 4d4abce..0b342ba 100644
--- a/test/unit/tenant_test.rb
+++ b/test/unit/tenant_test.rb
@@ -2,23 +2,23 @@ require 'test_helper'
class TenantTest < ActiveSupport::TestCase
def test_should_have_a_valid_factory
- assert Factory.build(:tenant).valid?
+ assert FactoryGirl.build(:tenant).valid?
end
def test_should_have_unique_name
- tenant = Factory.create(:tenant)
- assert !Factory.build(:tenant, :name => tenant.name).valid?
- assert Factory.build(:tenant, :name => "different_#{tenant.name}").valid?
+ tenant = FactoryGirl.create(:tenant)
+ assert !FactoryGirl.build(:tenant, :name => tenant.name).valid?
+ assert FactoryGirl.build(:tenant, :name => "different_#{tenant.name}").valid?
end
def test_that_the_initial_state_should_be_active
- @tenant = Factory.create(:tenant)
+ @tenant = FactoryGirl.create(:tenant)
assert_equal 'active', @tenant.state
assert @tenant.active?
end
def test_not_active_state_will_not_be_displayed
- @tenant = Factory.create(:tenant)
+ @tenant = FactoryGirl.create(:tenant)
assert_equal 1, Tenant.count
@tenant.deactivate!