Merge pull request #1485 from internetee/1480-fix-client-hold-task

Add condition on not having clientHold status for force-delete job
This commit is contained in:
Timo Võhmar 2020-01-28 17:33:06 +02:00 committed by GitHub
commit c64f389794
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 2 deletions

View file

@ -38,4 +38,18 @@ class DomainCronTest < ActiveSupport::TestCase
assert_emails 1
end
def test_does_not_sets_hold_if_already_set
Setting.redemption_grace_period = 30
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
travel_to Time.zone.parse('2010-07-05')
@domain.schedule_force_delete(type: :soft)
@domain.reload
@domain.update(template_name: 'legal_person', statuses: [DomainStatus::CLIENT_HOLD])
travel_to Time.zone.parse('2010-08-06')
DomainCron.start_client_hold
assert_emails 0
end
end