summaryrefslogtreecommitdiff
path: root/users/test/unit/user_test.rb
diff options
context:
space:
mode:
authorazul <azul@riseup.net>2013-01-17 22:45:39 -0800
committerazul <azul@riseup.net>2013-01-17 22:45:39 -0800
commit168c36b578d675c99aad62a350aa68cc1b6d1316 (patch)
treecd1df0a9a7d3f0a9812b512cfb93db0f79b0421f /users/test/unit/user_test.rb
parent19d563e2e2db98ecc5143229f554df6a09bc457e (diff)
parent27730c7e665ed64e691fdf6dbeebc39c8bfbbc4b (diff)
Merge pull request #18 from leapcode/feature/fixed-email-address
make email address just login@domain.tld
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