-
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.
Merge pull request #2187 from internetee/2185-mail-validation-event-t…
…hreshold-not-applied 2185 mail validation event threshold not applied
- Loading branch information
Showing
5 changed files
with
44 additions
and
9 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
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 |
---|---|---|
|
@@ -20,7 +20,9 @@ def test_if_fd_need_to_be_set_if_invalid_email | |
|
||
contact = @domain.admin_contacts.first | ||
contact.update_attribute(:email, email) | ||
contact.verify_email | ||
(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD).times do | ||
contact.verify_email | ||
end | ||
contact.reload | ||
|
||
refute contact.validation_events.last.success? | ||
|
@@ -42,6 +44,24 @@ def test_if_fd_need_to_be_lifted_if_email_fixed | |
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')) | ||
assert_not @domain.force_delete_scheduled? | ||
travel_to Time.zone.parse('2010-07-05') | ||
|
||
email = '[email protected]' | ||
contact = @domain.admin_contacts.first | ||
contact.update_attribute(:email, email) | ||
(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD - 1).times do | ||
contact.verify_email(check_level: 'mx') | ||
end | ||
contact.reload | ||
|
||
refute contact.validation_events.limit(ValidationEvent::VALID_EVENTS_COUNT_THRESHOLD) | ||
.any?(&:success?) | ||
assert_not contact.need_to_start_force_delete? | ||
end | ||
|
||
def test_if_fd_need_to_be_set_if_invalid_mx | ||
@domain.update(valid_to: Time.zone.parse('2012-08-05')) | ||
assert_not @domain.force_delete_scheduled? | ||
|