typoed_email_validator: add new endings to the typo list

This commit is contained in:
Georg Gadinger 2022-10-13 07:59:54 +02:00
parent 0b625453e7
commit ea4a661368
2 changed files with 5 additions and 2 deletions

View File

@ -4,6 +4,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator
# this array contains "forbidden" email address endings
INVALID_ENDINGS = [
# without @:
".carrd",
".con",
".coom",
".cmo",

View File

@ -68,10 +68,12 @@ RSpec.describe User, type: :model do
# 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@protonmail.con"
# neither is .coom
# nor .coom
include_examples "invalid email", "fritz.fantom@gmail.coom"
# nor .cmo
include_examples "invalid email", "gustav.geldsack@gmail.cmo"