VRFS-2091 modified email regular expression to prevent 2 consecutive periods after the @
This commit is contained in:
parent
4621a6474d
commit
f39312662d
|
|
@ -11,7 +11,7 @@ module JamRuby
|
|||
|
||||
@@log = Logging.logger[User]
|
||||
|
||||
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
|
||||
VALID_EMAIL_REGEX = /\A[\w+\-.]+@([a-z\d\-]+\.)+[a-z]+\z/i
|
||||
JAM_REASON_REGISTRATION = 'r'
|
||||
JAM_REASON_NETWORK_TEST = 'n'
|
||||
JAM_REASON_FTUE = 'g'
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ describe User do
|
|||
|
||||
describe "when email format is invalid" do
|
||||
it "should be invalid" do
|
||||
addresses = %w[user@foo,com user_at_foo.org example.user@foo.]
|
||||
addresses = %w[user@foo,com user_at_foo.org example.user@foo. blah@gmail..com]
|
||||
addresses.each do |invalid_address|
|
||||
@user.email = invalid_address
|
||||
@user.should_not be_valid
|
||||
|
|
|
|||
Loading…
Reference in New Issue