diff --git a/test/jobs/outzone_invalid_email_domains_job_test.rb b/test/jobs/outzone_invalid_email_domains_job_test.rb index dd7ce41c2..688494183 100644 --- a/test/jobs/outzone_invalid_email_domains_job_test.rb +++ b/test/jobs/outzone_invalid_email_domains_job_test.rb @@ -9,6 +9,9 @@ class OutzoneInvalidEmailDomainsJobTest < ActiveJob::TestCase end def test_set_outzone_datetime_for_fd_domains_by_invalid_emails + @domain.update(valid_to: Time.zone.now + 3.years) + @domain.reload + assert_nil @domain.outzone_at @domain.schedule_force_delete(type: :soft) @@ -19,24 +22,7 @@ class OutzoneInvalidEmailDomainsJobTest < ActiveJob::TestCase @domain.reload assert @domain.force_delete_scheduled? - assert @domain.valid_to < Time.zone.now + 1.year + assert @domain.valid_to > Time.zone.now + 1.year assert_equal @domain.outzone_at, @domain.force_delete_start + Setting.expire_warning_period.day end - - private - - def prepare_contact - assert_not @domain.force_delete_scheduled? - email = '~@internet.ee' - - contact = @domain.admin_contacts.first - contact.update_attribute(:email, email) - (ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD).times do - contact.verify_email - end - contact.reload - - refute contact.validation_events.last.success? - assert contact.need_to_start_force_delete? - end end