mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
fixed error
This commit is contained in:
parent
8524503582
commit
2543b9c1f8
6 changed files with 20 additions and 155 deletions
|
@ -440,38 +440,6 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
assert @domain.status_notes[DomainStatus::FORCE_DELETE].include? email_two
|
||||
end
|
||||
|
||||
def test_lifts_force_delete_if_contact_fixed
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
email = '`@internet.ee'
|
||||
|
||||
Truemail.configure.default_validation_type = :regex
|
||||
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
contact.verify_email
|
||||
|
||||
assert contact.email_verification_failed?
|
||||
|
||||
@domain.reload
|
||||
|
||||
assert @domain.force_delete_scheduled?
|
||||
contact.update_attribute(:email, 'aaa@bbb.com')
|
||||
contact.reload
|
||||
contact.verify_email
|
||||
|
||||
assert contact.need_to_lift_force_delete?
|
||||
refute contact.need_to_start_force_delete?
|
||||
|
||||
assert_not contact.email_verification_failed?
|
||||
CheckForceDeleteLift.perform_now
|
||||
|
||||
@domain.reload
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
assert_nil @domain.status_notes[DomainStatus::FORCE_DELETE]
|
||||
end
|
||||
|
||||
def test_lifts_force_delete_after_bounce_changes
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
|
|
|
@ -29,20 +29,7 @@ class ValidationEventTest < ActiveSupport::TestCase
|
|||
assert contact.need_to_start_force_delete?
|
||||
end
|
||||
|
||||
def test_if_fd_need_to_be_lifted_if_email_fixed
|
||||
test_if_fd_need_to_be_set_if_invalid_email
|
||||
|
||||
email = 'email@internet.ee'
|
||||
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
|
||||
contact.verify_email
|
||||
contact.reload
|
||||
|
||||
assert contact.need_to_lift_force_delete?
|
||||
assert contact.validation_events.last.success?
|
||||
end
|
||||
|
||||
def test_fd_didnt_set_if_mx_interation_less_then_value
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
|
@ -52,7 +39,7 @@ class ValidationEventTest < ActiveSupport::TestCase
|
|||
email = 'email@somestrangedomain12345.ee'
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD - 1).times do
|
||||
(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD - 4).times do
|
||||
contact.verify_email(check_level: 'mx')
|
||||
end
|
||||
contact.reload
|
||||
|
@ -80,19 +67,6 @@ class ValidationEventTest < ActiveSupport::TestCase
|
|||
assert contact.need_to_start_force_delete?
|
||||
end
|
||||
|
||||
def test_if_fd_need_to_be_lifted_if_mx_fixed
|
||||
test_if_fd_need_to_be_set_if_invalid_mx
|
||||
|
||||
email = 'email@internet.ee'
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
contact.verify_email(check_level: 'mx')
|
||||
|
||||
contact.reload
|
||||
assert contact.need_to_lift_force_delete?
|
||||
assert contact.validation_events.last.success?
|
||||
end
|
||||
|
||||
def test_if_fd_need_to_be_set_if_invalid_smtp
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
|
@ -101,27 +75,12 @@ class ValidationEventTest < ActiveSupport::TestCase
|
|||
email = 'email@somestrangedomain12345.ee'
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD.times do
|
||||
contact.verify_email(check_level: 'smtp')
|
||||
end
|
||||
contact.verify_email(check_level: 'smtp')
|
||||
|
||||
contact.reload
|
||||
|
||||
refute contact.validation_events.limit(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD)
|
||||
.any?(&:success?)
|
||||
assert contact.need_to_start_force_delete?
|
||||
end
|
||||
|
||||
def test_if_fd_need_to_be_lifted_if_smtp_fixed
|
||||
test_if_fd_need_to_be_set_if_invalid_smtp
|
||||
|
||||
email = 'valid@internet.ee'
|
||||
contact = @domain.admin_contacts.first
|
||||
contact.update_attribute(:email, email)
|
||||
contact.verify_email(check_level: 'smtp')
|
||||
|
||||
contact.reload
|
||||
assert contact.need_to_lift_force_delete?
|
||||
assert contact.validation_events.last.success?
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue