mirror of
https://github.com/internetee/registry.git
synced 2025-06-07 05:05:45 +02:00
Implemented job and test
This commit is contained in:
parent
eac7dd352b
commit
f3612fc1e4
2 changed files with 25 additions and 0 deletions
|
@ -16,6 +16,21 @@ class BouncedMailAddressTest < ActiveSupport::TestCase
|
|||
@contact_email = "john@inbox.test"
|
||||
end
|
||||
|
||||
def test_remove_bounced_email_after_changed_related_email
|
||||
@bounced_mail.update(email: @contact_email)
|
||||
@bounced_mail.save
|
||||
|
||||
contacts_with_bounced_mails = Contact.where(email: @contact_email)
|
||||
contacts_with_bounced_mails.each do |contact|
|
||||
contact.email = "sara@inbox.com"
|
||||
contact.save
|
||||
end
|
||||
|
||||
BouncedEmailsCleanerJob.perform_now
|
||||
|
||||
assert_nil BouncedMailAddress.find_by(email: @contact_email)
|
||||
end
|
||||
|
||||
def test_soft_force_delete_related_domains
|
||||
domain_contacts = Contact.where(email: @contact_email).map(&:domain_contacts).flatten
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue