mirror of
https://github.com/internetee/registry.git
synced 2025-07-30 14:36:22 +02:00
fix: prevent client_hold status from returning after manual removal
- Add flag in force_delete_data to track manual client_hold removal - Update ProcessClientHold to respect manual status removal - Add test to verify client_hold doesn't return after admin removes it When an admin manually removes the client_hold status from a domain, it should not be automatically re-added by the ProcessClientHold job. This change tracks manual removals and prevents the status from being re-added while maintaining the force delete process.
This commit is contained in:
parent
c4bbad934e
commit
6194c5c58a
2 changed files with 30 additions and 1 deletions
|
@ -535,6 +535,31 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
assert_enqueued_jobs 8
|
||||
end
|
||||
|
||||
def test_client_hold_does_not_return_after_manual_removal
|
||||
domain = domains(:shop)
|
||||
domain.update(valid_to: Time.zone.parse('2010-10-05'))
|
||||
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
domain.schedule_force_delete(type: :fast_track)
|
||||
|
||||
travel_to Time.zone.parse('2010-07-25')
|
||||
Domains::ClientHold::SetClientHold.run!
|
||||
domain.reload
|
||||
|
||||
assert_includes(domain.statuses, DomainStatus::CLIENT_HOLD)
|
||||
assert_equal(domain.force_delete_data['client_hold_mandatory'], 'Has been set')
|
||||
|
||||
domain.statuses.delete(DomainStatus::CLIENT_HOLD)
|
||||
domain.save!
|
||||
domain.reload
|
||||
|
||||
Domains::ClientHold::SetClientHold.run!
|
||||
domain.reload
|
||||
|
||||
assert_not_includes(domain.statuses, DomainStatus::CLIENT_HOLD)
|
||||
assert_equal(domain.force_delete_data['client_hold_mandatory'], 'Has been set')
|
||||
end
|
||||
|
||||
def prepare_bounced_email_address(email)
|
||||
@bounced_mail = BouncedMailAddress.new
|
||||
@bounced_mail.email = email
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue