From 5b70be74c228e834d96653f4500660df8c4ad247 Mon Sep 17 00:00:00 2001 From: Georg Gadinger Date: Sun, 24 Jul 2022 21:43:28 +0200 Subject: [PATCH] typoed_email_validator: add new endings to the typo list --- app/validators/typoed_email_validator.rb | 2 ++ spec/models/user_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/app/validators/typoed_email_validator.rb b/app/validators/typoed_email_validator.rb index c76afa8f..274b587b 100644 --- a/app/validators/typoed_email_validator.rb +++ b/app/validators/typoed_email_validator.rb @@ -21,10 +21,12 @@ class TypoedEmailValidator < ActiveModel::EachValidator gmaill.com gmali.com hotamil.com + hotmai.com hotmaill.com iclooud.com iclould.com icluod.com + yahooo.com ].map { "@#{_1}" } ].freeze diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index f1bb145e..93aaa7f2 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -88,11 +88,13 @@ RSpec.describe User, type: :model do include_examples "invalid email", "fritz.fantom@gmaill.com" include_examples "invalid email", "fritz.fantom@gmali.com" include_examples "invalid email", "fritz.fantom@hotamil.com" + include_examples "invalid email", "fritz.fantom@hotmai.com" include_examples "invalid email", "fritz.fantom@hotmailcom" include_examples "invalid email", "fritz.fantom@hotmaill.com" include_examples "invalid email", "fritz.fantom@iclooud.com" include_examples "invalid email", "fritz.fantom@iclould.com" include_examples "invalid email", "fritz.fantom@icluod.com" + include_examples "invalid email", "fritz.fantom@yahooo.com" # gail.com would be a valid email address, but enough people typo it # # if you're the owner of that TLD and would like to use your email on