summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-07-19 11:20:01 +0200
committerAzul <azul@leap.se>2013-07-24 10:55:51 +0200
commit51582a668b04d2c1322ad1babe8599ae8797cd3b (patch)
tree32116eb73310effb21d2604604127e8116d69214
parent34c06b49f26bbffe2e29477f0b55a56a38aa0ce7 (diff)
test user validates uniqueness of login amongst aliases
-rw-r--r--users/test/unit/user_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/users/test/unit/user_test.rb b/users/test/unit/user_test.rb
index 5d1fe06..f303c8d 100644
--- a/users/test/unit/user_test.rb
+++ b/users/test/unit/user_test.rb
@@ -56,6 +56,13 @@ class UserTest < ActiveSupport::TestCase
other_user.destroy
end
+ test "login needs to be unique amongst aliases" do
+ other_user = FactoryGirl.create :user
+ other_user.create_identity address: @user.login
+ assert !@user.valid?
+ other_user.destroy
+ end
+
test "deprecated public key api still works" do
key = SecureRandom.base64(4096)
@user.public_key = key