1
0
Fork 0
mirror of https://github.com/heartcombo/devise.git synced 2022-11-09 12:18:31 -05:00

Improve the regexp a bit more.

This commit is contained in:
José Valim 2011-08-29 14:55:56 +02:00
parent 7396c6911d
commit 7b1418be3b
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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