Add test for validating info epp response on disputed domain against our own schema

This commit is contained in:
Alex Sherman 2021-04-16 15:22:14 +05:00
parent fbe63ae062
commit 661ab8e0ac
3 changed files with 56 additions and 2 deletions

View file

@ -34,6 +34,43 @@ class EppDomainInfoBaseTest < EppTestCase
assert_equal '2010-07-07T00:00:00+03:00', response_xml.at_xpath('//domain:exDate', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
end
def test_returns_valid_response_if_disputed
dispute = disputes(:expired)
dispute.update!(starts_at: Time.zone.now, expires_at: Time.zone.now + 5.days, closed: nil)
domain = domains(:shop)
domain.update_columns(statuses: [DomainStatus::DISPUTED],
created_at: Time.zone.parse('2010-07-05'),
updated_at: Time.zone.parse('2010-07-06'),
creator_str: 'test',
valid_to: Time.zone.parse('2010-07-07'))
domain.versions.destroy_all
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
<command>
<info>
<domain:info xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>shop.test</domain:name>
</domain:info>
</info>
</command>
</epp>
XML
post epp_info_path, params: { frame: request_xml },
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
schema = EPP_ALL_SCHEMA
schema_validation_errors = schema.validate(response_xml)
assert_equal 0, schema_validation_errors.size
end
def test_reveals_transfer_code_when_domain_is_owned_by_current_user
assert_equal '65078d5', domains(:shop).transfer_code
@ -109,4 +146,4 @@ class EppDomainInfoBaseTest < EppTestCase
assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw',
'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')
end
end
end