diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-01-10 11:29:35 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2009-01-10 11:29:35 +0000 |
commit | 212bf1e2bbe680261beb4e096a051f63471cc45f (patch) | |
tree | 1a81e3848166a991a1d54ebcb2fc0bd933920dec /test/unit/user_test.rb | |
parent | 6768bec4560e3c9a31578e2879f345f4c9e77a17 (diff) | |
download | redmine-212bf1e2bbe680261beb4e096a051f63471cc45f.tar.gz redmine-212bf1e2bbe680261beb4e096a051f63471cc45f.zip |
Makes email adress uniqueness case-insensitive (#2473).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2253 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/user_test.rb')
-rw-r--r-- | test/unit/user_test.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index 319a1c2f4..e8500623a 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -47,6 +47,19 @@ class UserTest < Test::Unit::TestCase user.password, user.password_confirmation = "password", "password"
assert user.save
+ end + + def test_mail_uniqueness_should_not_be_case_sensitive + u = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo") + u.login = 'newuser1' + u.password, u.password_confirmation = "password", "password" + assert u.save + + u = User.new(:firstname => "new", :lastname => "user", :mail => "newUser@Somenet.foo") + u.login = 'newuser2' + u.password, u.password_confirmation = "password", "password" + assert !u.save + assert_equal 'activerecord_error_taken', u.errors.on(:mail) end
def test_update |