mirror of
https://github.com/internetee/registry.git
synced 2025-08-28 20:13:41 +02:00
fixed tests
This commit is contained in:
parent
3d81164b23
commit
1af5d63995
1 changed files with 4 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue