Makes email adress uniqueness case-insensitive (#2473).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2253 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2009-01-10 11:29:35 +00:00
parent 6768bec456
commit 212bf1e2bb
2 changed files with 14 additions and 1 deletions
+13
View File
@@ -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