Fix deprecated email_notification usage in tests

This commit is contained in:
Alex Sherman 2021-07-06 14:45:11 +05:00
parent d48b0f4401
commit 70a6a44525
12 changed files with 15 additions and 164 deletions

View file

@ -1,31 +0,0 @@
module EmailAddressConverter
module_function
def punycode_to_unicode(email)
return email if domain(email) == 'not_found'
local = local(email)
domain = SimpleIDN.to_unicode(domain(email))
"#{local}@#{domain}"&.downcase
end
def unicode_to_punycode(email)
return email if domain(email) == 'not_found'
local = local(email)
domain = SimpleIDN.to_ascii(domain(email))
"#{local}@#{domain}"&.downcase
end
def domain(email)
Mail::Address.new(email).domain&.downcase || 'not_found'
rescue Mail::Field::IncompleteParseError
'not_found'
end
def local(email)
Mail::Address.new(email).local&.downcase || email
rescue Mail::Field::IncompleteParseError
email
end
end

View file

@ -3,7 +3,7 @@ require 'rake_option_parser_boilerplate'
require 'syslog/logger'
namespace :verify_email do
# bundle exec rake verify_email:check_all -- -d=shop.test --check_level=mx --spam_protect=true
# bundle exec rake verify_email:check_all -- --domain_name=shop.test --check_level=mx --spam_protect=true
# bundle exec rake verify_email:check_all -- -dshop.test -cmx -strue
desc 'Starts verifying email jobs with optional check level and spam protection'
task check_all: :environment do