summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-17 15:09:58 +0100
committerAzul <azul@leap.se>2013-01-17 15:16:53 +0100
commita8ec73a0307924610023525786bb3a9eb8b173e1 (patch)
tree16d937bfea4d18a39aad1eec86edfd4f6467d708 /users/test/unit/user_test.rb
parent7f7ba4f3d72104d67e9ecf839c9688c0580d4063 (diff)
unit tests passing
Diffstat (limited to 'users/test/unit/user_test.rb')
-rw-r--r--users/test/unit/user_test.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
index 917728b..66563a3 100644
--- a/users/test/unit/user_test.rb
+++ b/users/test/unit/user_test.rb
@@ -57,4 +57,18 @@ class UserTest < ActiveSupport::TestCase
assert @user.is_admin?
end
+ test "login needs to be unique" do
+ other_user = FactoryGirl.create :user, login: @user.login
+ assert !@user.valid?
+ other_user.destroy
+ end
+
+ test "login needs to be different from other peoples email aliases" do
+ other_user = FactoryGirl.create :user
+ other_user.email_aliases.build :email => @user.login
+ other_user.save
+ assert !@user.valid?
+ other_user.destroy
+ end
+
end