mirror of
https://github.com/internetee/registry.git
synced 2025-07-27 21:16:12 +02:00
Remove legacy code
This commit is contained in:
parent
626edbd4c3
commit
c246bbaa6d
3 changed files with 8 additions and 11 deletions
|
@ -7,7 +7,6 @@ class ValidationEventCheckForceDeleteJob < ApplicationJob
|
|||
event.start_force_delete
|
||||
elsif contact.need_to_lift_force_delete?
|
||||
event.refresh_status_notes
|
||||
event.lift_force_delete
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -92,14 +92,4 @@ class ValidationEvent < ApplicationRecord
|
|||
purge_date: domain.purge_date,
|
||||
email: domain.status_notes[DomainStatus::FORCE_DELETE]))
|
||||
end
|
||||
|
||||
def lift_force_delete
|
||||
domain_contacts = Contact.where(email: email).map(&:domain_contacts).flatten
|
||||
registrant_domains = Domain.where(registrant_id: Registrant.where(email: email).pluck(:id))
|
||||
domains = domain_contacts.map(&:domain).flatten + registrant_domains
|
||||
|
||||
domains.each do |domain|
|
||||
Domains::ForceDeleteLift::Base.run(domain: domain)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
require 'test_helper'
|
||||
|
||||
class ForceDeleteTest < ActionMailer::TestCase
|
||||
include ActiveJob::TestHelper
|
||||
|
||||
setup do
|
||||
@domain = domains(:shop)
|
||||
Setting.redemption_grace_period = 30
|
||||
|
@ -396,6 +398,7 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
contact.verify_email
|
||||
end
|
||||
|
||||
perform_enqueued_jobs
|
||||
@domain.reload
|
||||
|
||||
assert @domain.force_delete_scheduled?
|
||||
|
@ -428,6 +431,7 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
contact_first.verify_email
|
||||
end
|
||||
|
||||
perform_enqueued_jobs
|
||||
domain.reload
|
||||
|
||||
assert_equal domain.status_notes[DomainStatus::FORCE_DELETE], invalid_emails
|
||||
|
@ -455,6 +459,8 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
|
||||
travel_to Time.zone.parse('2010-07-05 0:00:03')
|
||||
contact_first.verify_email
|
||||
|
||||
perform_enqueued_jobs
|
||||
domain.reload
|
||||
|
||||
assert_equal domain.status_notes[DomainStatus::FORCE_DELETE], invalid_email
|
||||
|
@ -472,12 +478,14 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
contact_one = @domain.admin_contacts.first
|
||||
contact_one.update_attribute(:email, email_one)
|
||||
contact_one.verify_email
|
||||
perform_enqueued_jobs
|
||||
|
||||
assert contact_one.need_to_start_force_delete?
|
||||
|
||||
contact_two = @domain.admin_contacts.first
|
||||
contact_two.update_attribute(:email, email_two)
|
||||
contact_two.verify_email
|
||||
perform_enqueued_jobs
|
||||
|
||||
assert contact_two.need_to_start_force_delete?
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue