mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 13:15:40 +02:00
changed list of email received
This commit is contained in:
parent
b2226e3ea2
commit
5b276dd729
2 changed files with 29 additions and 3 deletions
|
@ -671,9 +671,8 @@ class Domain < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def expired_domain_contact_emails
|
def expired_domain_contact_emails
|
||||||
force_delete_contact_emails.reject do |email|
|
(primary_contact_emails +
|
||||||
BouncedMailAddress.where(email: email).count.positive?
|
["info@#{name}", "#{prepared_domain_name}@#{name}"]).uniq
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def all_related_emails
|
def all_related_emails
|
||||||
|
|
27
test/interactions/expire_period/process_expired_test.rb
Normal file
27
test/interactions/expire_period/process_expired_test.rb
Normal file
|
@ -0,0 +1,27 @@
|
||||||
|
require 'test_helper'
|
||||||
|
|
||||||
|
class StartTest < ActiveSupport::TestCase
|
||||||
|
include ActionMailer::TestHelper
|
||||||
|
|
||||||
|
setup do
|
||||||
|
@domain = domains(:shop)
|
||||||
|
@domain.update(expire_time: Time.zone.now - 1.day)
|
||||||
|
ActionMailer::Base.deliveries.clear
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_expired_domain_contact_emails_should_not_contain_tech_contacts
|
||||||
|
contact_list = []
|
||||||
|
@domain.tech_contacts.each do |contact|
|
||||||
|
contact_list << contact.email
|
||||||
|
end
|
||||||
|
|
||||||
|
email_address = @domain.expired_domain_contact_emails
|
||||||
|
email = DomainExpireMailer.expired_soft(domain: @domain,
|
||||||
|
registrar: @domain.registrar,
|
||||||
|
email: email_address).deliver_now
|
||||||
|
|
||||||
|
email.to.each do |received|
|
||||||
|
assert_not contact_list.include? received
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue