summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
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