summaryrefslogtreecommitdiff
path: root/test/unit/user_test.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-22 15:33:06 +0100
commit39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch)
tree6c88289c9f99be0af8635636fcdf64102090e5ec /test/unit/user_test.rb
parent5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff)
parent6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff)
Merge branch 'develop'5.1-beta1
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