summaryrefslogtreecommitdiff
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:17:32 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2012-12-30 22:17:32 +0100
commitaf79440bd75d2cffb2eb0ba43b5cfe918a78162c (patch)
treefd6c4dab5dc56fed5f616ddec20e1f82780f20fe /test/unit/user_test.rb
parent648f51a0ac97675d6cdf6a4b0c3c75bc9ea23168 (diff)
parent9f14a9a6573db607b79124524088803812454515 (diff)
Merge branch 'rename_factory_class' into develop
Conflicts: Gemfile.lock
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r--test/unit/user_test.rb24
1 files changed, 12 insertions, 12 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb
index bb89e77..5fa1e4a 100644
--- a/test/unit/user_test.rb
+++ b/test/unit/user_test.rb
@@ -3,21 +3,21 @@ require 'test_helper'
class UserTest < ActiveSupport::TestCase
def test_should_have_a_valid_factory
- assert Factory.build(:user).valid?
+ assert FactoryGirl.build(:user).valid?
end
def test_should_have_a_unique_email_address
- user = Factory.create(:user)
- assert !Factory.build(:user, :email => user.email).valid?
- assert Factory.build(:user, :email => "different_#{user.email}").valid?
+ user = FactoryGirl.create(:user)
+ assert !FactoryGirl.build(:user, :email => user.email).valid?
+ assert FactoryGirl.build(:user, :email => "different_#{user.email}").valid?
end
def test_can_not_move_to_a_current_tenant_without_a_membership_relation
- super_tenant = Factory.create(:tenant)
- good_tenant = Factory.create(:tenant)
- evil_tenant = Factory.create(:tenant)
+ super_tenant = FactoryGirl.create(:tenant)
+ good_tenant = FactoryGirl.create(:tenant)
+ evil_tenant = FactoryGirl.create(:tenant)
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
super_tenant.tenant_memberships.create(:user_id => user.id)
good_tenant.tenant_memberships.create(:user_id => user.id)
@@ -27,7 +27,7 @@ class UserTest < ActiveSupport::TestCase
end
test "should be possible to modify the user without changing the PIN" do
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
pin_salt = user.pin_salt
pin_hash = user.pin_hash
user.middle_name = "#{user.middle_name} Foo"
@@ -39,7 +39,7 @@ class UserTest < ActiveSupport::TestCase
end
test "should be possible to change the PIN" do
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
pin_salt = user.pin_salt
pin_hash = user.pin_hash
new_pin = '453267'
@@ -52,7 +52,7 @@ class UserTest < ActiveSupport::TestCase
end
test "should not be possible to change the PIN if the confirmation does not match" do
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
pin_salt = user.pin_salt
pin_hash = user.pin_hash
user.new_pin = '123001'
@@ -67,7 +67,7 @@ class UserTest < ActiveSupport::TestCase
end
test "PIN must be numeric" do
- user = Factory.create(:user)
+ user = FactoryGirl.create(:user)
new_pin = 'xxxx'
user.new_pin = new_pin
user.new_pin_confirmation = new_pin