-
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 #2375 from internetee/2374-deprecated-validation-e…
…vents Prevent deprecated validation events
- Loading branch information
Showing
4 changed files
with
52 additions
and
30 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -80,6 +80,35 @@ def test_notifies_contact_by_email_when_email_is_changed | |
assert_emails 1 | ||
end | ||
|
||
def test_destroy_old_validation_when_email_is_changed | ||
@contact.verify_email | ||
old_validation_event = @contact.validation_events.first | ||
@contact.update_columns(code: @contact.code.upcase) | ||
|
||
request_xml = <<-XML | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}"> | ||
<command> | ||
<update> | ||
<contact:update xmlns:contact="#{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')}"> | ||
<contact:id>john-001</contact:id> | ||
<contact:chg> | ||
<contact:email>[email protected]</contact:email> | ||
</contact:chg> | ||
</contact:update> | ||
</update> | ||
</command> | ||
</epp> | ||
XML | ||
|
||
post epp_update_path, params: { frame: request_xml }, | ||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } | ||
|
||
assert_raises(ActiveRecord::RecordNotFound) do | ||
ValidationEvent.find(old_validation_event.id) | ||
end | ||
end | ||
|
||
def test_skips_notifying_contact_when_email_is_not_changed | ||
assert_equal 'john-001', @contact.code | ||
assert_equal '[email protected]', @contact.email | ||
|