diff --git a/app/validators/typoed_email_validator.rb b/app/validators/typoed_email_validator.rb index dc80bb2a..279c4950 100644 --- a/app/validators/typoed_email_validator.rb +++ b/app/validators/typoed_email_validator.rb @@ -4,6 +4,7 @@ class TypoedEmailValidator < ActiveModel::EachValidator # this array contains "forbidden" email address endings INVALID_ENDINGS = [ # without @: + ".carrd", ".con", ".coom", ".cmo", diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 3250d212..5d12058f 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -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"