fixed tests

This commit is contained in:
olegphenomenon 2022-09-09 13:54:16 +03:00
parent 3d81164b23
commit 1af5d63995

View file

@ -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