Do not show 2 validation errors when user mail is blank.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@6168 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -41,6 +41,13 @@ class UserTest < ActiveSupport::TestCase
|
||||
u.mail = " foo@bar.com "
|
||||
assert_equal "foo@bar.com", u.mail
|
||||
end
|
||||
|
||||
def test_mail_validation
|
||||
u = User.new
|
||||
u.mail = ''
|
||||
assert !u.valid?
|
||||
assert_equal I18n.translate('activerecord.errors.messages.blank'), u.errors.on(:mail)
|
||||
end
|
||||
|
||||
def test_create
|
||||
user = User.new(:firstname => "new", :lastname => "user", :mail => "newuser@somenet.foo")
|
||||
|
||||
Reference in New Issue
Block a user