mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 02:05:57 +02:00
Implement FD notes updating
This commit is contained in:
parent
f461388783
commit
c47b093a45
6 changed files with 83 additions and 2 deletions
|
@ -411,6 +411,57 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
assert notification.text.include? asserted_text
|
||||
end
|
||||
|
||||
def test_force_delete_notes
|
||||
domain = domains(:airport)
|
||||
domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not domain.force_delete_scheduled?
|
||||
travel_to Time.zone.parse('2010-07-05')
|
||||
email_1 = '`@internet.ee'
|
||||
asserted_text = "Invalid email: #{email_1}"
|
||||
|
||||
Truemail.configure.default_validation_type = :regex
|
||||
|
||||
contact_first = domain.admin_contacts.first
|
||||
contact_first.update_attribute(:email, email_1)
|
||||
|
||||
ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD.times do
|
||||
contact_first.verify_email
|
||||
end
|
||||
|
||||
assert contact_first.email_verification_failed?
|
||||
|
||||
domain.reload
|
||||
email_2 = '`@internet2.ee'
|
||||
contact_second = domain.admin_contacts.last
|
||||
contact_second.update_attribute(:email, email_2)
|
||||
|
||||
ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD.times do
|
||||
contact_second.verify_email
|
||||
end
|
||||
|
||||
assert contact_second.email_verification_failed?
|
||||
|
||||
domain.reload
|
||||
contact_first.update(
|
||||
email: 'correct_email@internet2.ee',
|
||||
email_history: email_1
|
||||
)
|
||||
|
||||
|
||||
contact_first.verify_email
|
||||
|
||||
|
||||
domain.reload
|
||||
assert domain.force_delete_scheduled?
|
||||
assert_equal 'invalid_email', domain.template_name
|
||||
assert_equal Date.parse('2010-09-19'), domain.force_delete_date.to_date
|
||||
assert_equal Date.parse('2010-08-05'), domain.force_delete_start.to_date
|
||||
|
||||
assert_equal domain.status_notes[DomainStatus::FORCE_DELETE], email_2
|
||||
notification = domain.registrar.notifications.last
|
||||
assert notification.text.include? asserted_text
|
||||
end
|
||||
|
||||
def test_domain_should_have_several_bounced_emails
|
||||
@domain.update(valid_to: Time.zone.parse('2012-08-05'))
|
||||
assert_not @domain.force_delete_scheduled?
|
||||
|
@ -458,7 +509,7 @@ class ForceDeleteTest < ActionMailer::TestCase
|
|||
notification = @domain.registrar.notifications.last
|
||||
assert notification.text.include? asserted_text
|
||||
|
||||
@domain.registrant.update(email: 'aaa@bbb.com')
|
||||
@domain.registrant.update(email: 'aaa@bbb.com', email_history: email)
|
||||
@domain.registrant.verify_email
|
||||
assert @domain.registrant.need_to_lift_force_delete?
|
||||
CheckForceDeleteLift.perform_now
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue