mirror of
https://github.com/internetee/registry.git
synced 2025-07-26 04:28:27 +02:00
Fix deprecated email_notification usage in tests
This commit is contained in:
parent
d48b0f4401
commit
70a6a44525
12 changed files with 15 additions and 164 deletions
|
@ -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
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue