-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
31 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -325,41 +325,51 @@ def test_schedules_force_delete_after_bounce | |
@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 = @domain.admin_contacts.first.email | ||
asserted_text = "Force delete set on domain shop.test. Invalid email - #{email}" | ||
|
||
prepare_bounced_email_address(@domain.admin_contacts.first.email) | ||
prepare_bounced_email_address(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 | ||
notification = @domain.registrar.notifications.last | ||
assert_equal notification.text, asserted_text | ||
end | ||
|
||
def test_schedules_force_delete_after_registrant_bounce | ||
@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 = @domain.registrant.email | ||
asserted_text = "Force delete set on domain shop.test. Invalid email - #{email}" | ||
|
||
prepare_bounced_email_address(@domain.registrant.email) | ||
prepare_bounced_email_address(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 | ||
notification = @domain.registrar.notifications.last | ||
assert_equal notification.text, asserted_text | ||
end | ||
|
||
def test_schedules_force_delete_invalid_contact | ||
@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 = 'some@[email protected]' | ||
asserted_text = "Force delete set on domain shop.test. Invalid email - #{email}" | ||
|
||
Truemail.configure.default_validation_type = :regex | ||
|
||
contact = @domain.admin_contacts.first | ||
contact.update_attribute(:email, 'some@[email protected]') | ||
contact.update_attribute(:email, email) | ||
contact.email_verification.verify | ||
|
||
assert contact.email_verification_failed? | ||
|
@@ -370,6 +380,8 @@ def test_schedules_force_delete_invalid_contact | |
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 | ||
notification = @domain.registrar.notifications.last | ||
assert_equal notification.text, asserted_text | ||
end | ||
|
||
def prepare_bounced_email_address(email) | ||
|