made support test schema domain version 1.2

This commit is contained in:
Oleg Hasjanov 2021-06-28 12:47:24 +03:00
parent ae6bad3e73
commit 4c5e4d7898
41 changed files with 967 additions and 451 deletions

View file

@ -17,10 +17,10 @@ class EppDomainCheckAuctionTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>auction.test</domain:name>
</domain:check>
</check>
@ -34,8 +34,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_idn_ascii_domain_is_unavailable_when_at_auction
@ -43,10 +43,10 @@ class EppDomainCheckAuctionTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>xn--pramiid-n2a.test</domain:name>
</domain:check>
</check>
@ -60,8 +60,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_idn_unicode_domain_is_unavailable_when_at_auction
@ -69,10 +69,10 @@ class EppDomainCheckAuctionTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>püramiid.test</domain:name>
</domain:check>
</check>
@ -86,8 +86,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_unavailable_when_awaiting_payment
@ -95,10 +95,10 @@ class EppDomainCheckAuctionTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>auction.test</domain:name>
</domain:check>
</check>
@ -112,8 +112,8 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_available_when_payment_received
@ -121,10 +121,10 @@ class EppDomainCheckAuctionTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>auction.test</domain:name>
</domain:check>
</check>
@ -138,7 +138,7 @@ class EppDomainCheckAuctionTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_epp_response :completed_successfully
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")
end
end

View file

@ -4,10 +4,10 @@ class EppDomainCheckBaseTest < EppTestCase
def test_returns_valid_response
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>some.test</domain:name>
</domain:check>
</check>
@ -21,16 +21,16 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
assert_correct_against_schema response_xml
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_available_when_not_registered_or_blocked
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>available.test</domain:name>
</domain:check>
</check>
@ -43,8 +43,8 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")
end
def test_domain_is_available_when_reserved
@ -52,10 +52,10 @@ class EppDomainCheckBaseTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>reserved.test</domain:name>
</domain:check>
</check>
@ -68,17 +68,17 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")
end
def test_domain_is_unavailable_when_format_is_invalid
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>invalid</domain:name>
</domain:check>
</check>
@ -91,8 +91,8 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_unavailable_when_registered
@ -100,10 +100,10 @@ class EppDomainCheckBaseTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>shop.test</domain:name>
</domain:check>
</check>
@ -116,8 +116,8 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_unavailable_when_blocked
@ -125,10 +125,10 @@ class EppDomainCheckBaseTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>blocked.test</domain:name>
</domain:check>
</check>
@ -141,8 +141,8 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_domain_is_unavailable_when_zone_with_the_same_origin_exists
@ -150,10 +150,10 @@ class EppDomainCheckBaseTest < EppTestCase
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>test</domain:name>
</domain:check>
</check>
@ -166,17 +166,17 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail']
assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail']
assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text
end
def test_multiple_domains
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
<domain:name>one.test</domain:name>
<domain:name>two.test</domain:name>
<domain:name>three.test</domain:name>
@ -191,6 +191,6 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_correct_against_schema response_xml
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").size
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").size
end
end