typoed_email_validator: add new endings to the typo list
This commit is contained in:
Georg Gadinger 2023-01-30 08:07:55 +01:00 committed by GitHub
commit a29db9d2d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 0 deletions

View File

@ -7,6 +7,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator
INVALID_ENDINGS = [ INVALID_ENDINGS = [
# with @: # with @:
*%w[ *%w[
aoo.com
fmail.com fmail.com
gail.com gail.com
gamil.com gamil.com

View File

@ -81,6 +81,7 @@ RSpec.describe User, type: :model do
# nor .mail (.email is, however) # nor .mail (.email is, however)
include_examples "invalid email", "fritz.fantom@proton.mail" include_examples "invalid email", "fritz.fantom@proton.mail"
# common typos: # common typos:
include_examples "invalid email", "fritz.fantom@aoo.com"
include_examples "invalid email", "fritz.fantom@fmail.com" include_examples "invalid email", "fritz.fantom@fmail.com"
include_examples "invalid email", "fritz.fantom@gamil.com" include_examples "invalid email", "fritz.fantom@gamil.com"
include_examples "invalid email", "fritz.fantom@gemail.com" include_examples "invalid email", "fritz.fantom@gemail.com"