typoed_email_validator: add new endings to the typo list
This commit is contained in:
parent
0b625453e7
commit
ea4a661368
|
@ -4,6 +4,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator
|
||||||
# this array contains "forbidden" email address endings
|
# this array contains "forbidden" email address endings
|
||||||
INVALID_ENDINGS = [
|
INVALID_ENDINGS = [
|
||||||
# without @:
|
# without @:
|
||||||
|
".carrd",
|
||||||
".con",
|
".con",
|
||||||
".coom",
|
".coom",
|
||||||
".cmo",
|
".cmo",
|
||||||
|
|
|
@ -68,10 +68,12 @@ RSpec.describe User, type: :model do
|
||||||
|
|
||||||
# examples from the real world:
|
# examples from the real world:
|
||||||
|
|
||||||
# .con is not a valid TLD
|
# .carrd is not a valid TLD
|
||||||
|
include_examples "invalid email", "fritz.fantom@gmail.carrd"
|
||||||
|
# neither is .con
|
||||||
include_examples "invalid email", "fritz.fantom@gmail.con"
|
include_examples "invalid email", "fritz.fantom@gmail.con"
|
||||||
include_examples "invalid email", "fritz.fantom@protonmail.con"
|
include_examples "invalid email", "fritz.fantom@protonmail.con"
|
||||||
# neither is .coom
|
# nor .coom
|
||||||
include_examples "invalid email", "fritz.fantom@gmail.coom"
|
include_examples "invalid email", "fritz.fantom@gmail.coom"
|
||||||
# nor .cmo
|
# nor .cmo
|
||||||
include_examples "invalid email", "gustav.geldsack@gmail.cmo"
|
include_examples "invalid email", "gustav.geldsack@gmail.cmo"
|
||||||
|
|
Loading…
Reference in New Issue