mirror of
https://github.com/heartcombo/devise.git
synced 2026-01-10 23:38:10 -05:00
Improve the regexp a bit more.
This commit is contained in:
@@ -108,7 +108,7 @@ module Devise
|
||||
# an one (and only one) @ exists in the given string. This is mainly
|
||||
# to give user feedback and not to assert the e-mail validity.
|
||||
mattr_accessor :email_regexp
|
||||
@@email_regexp = /\A[^@]+@[^@]+\z/
|
||||
@@email_regexp = /\A[^@]+@([^@\.]+\.)+[^@\.]+\z/
|
||||
|
||||
# Range validation for password length
|
||||
mattr_accessor :password_length
|
||||
|
||||
@@ -29,7 +29,7 @@ class ValidatableTest < ActiveSupport::TestCase
|
||||
assert user.invalid?
|
||||
assert_not_equal 'is invalid', user.errors[:email].join
|
||||
|
||||
%w{invalid_email_format 123 $$$ () ☃}.each do |email|
|
||||
%w{invalid_email_format 123 $$$ () ☃ bla@bla.}.each do |email|
|
||||
user.email = email
|
||||
assert user.invalid?, 'should be invalid with email ' << email
|
||||
assert_equal 'is invalid', user.errors[:email].join
|
||||
|
||||
Reference in New Issue
Block a user