updated prefixes

This commit is contained in:
Oleg Hasjanov 2021-06-04 17:07:56 +03:00
parent 177ddf0a72
commit 9e8f760fc4
28 changed files with 146 additions and 146 deletions

View file

@ -7,7 +7,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>some.test</domain:name>
</domain:check>
</check>
@ -20,7 +20,7 @@ class EppDomainCheckBaseTest < EppTestCase
response_xml = Nokogiri::XML(response.body)
assert_epp_response :completed_successfully
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text
end
def test_domain_is_available_when_not_registered_or_blocked
@ -29,7 +29,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>available.test</domain:name>
</domain:check>
</check>
@ -41,8 +41,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")
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')}")
end
def test_domain_is_available_when_reserved
@ -53,7 +53,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>reserved.test</domain:name>
</domain:check>
</check>
@ -65,8 +65,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")
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')}")
end
def test_domain_is_unavailable_when_format_is_invalid
@ -75,7 +75,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>invalid</domain:name>
</domain:check>
</check>
@ -87,8 +87,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
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
end
def test_domain_is_unavailable_when_registered
@ -99,7 +99,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>shop.test</domain:name>
</domain:check>
</check>
@ -111,8 +111,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
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
end
def test_domain_is_unavailable_when_blocked
@ -123,7 +123,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>blocked.test</domain:name>
</domain:check>
</check>
@ -135,8 +135,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
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
end
def test_domain_is_unavailable_when_zone_with_the_same_origin_exists
@ -147,7 +147,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>test</domain:name>
</domain:check>
</check>
@ -159,8 +159,8 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['avail']
assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text
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
end
def test_multiple_domains
@ -169,7 +169,7 @@ class EppDomainCheckBaseTest < EppTestCase
<epp xmlns="#{Xsd::Schema.filename(for_prefix: 'epp-ee')}">
<command>
<check>
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis')}">
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
<domain:name>one.test</domain:name>
<domain:name>two.test</domain:name>
<domain:name>three.test</domain:name>
@ -183,6 +183,6 @@ class EppDomainCheckBaseTest < EppTestCase
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
response_xml = Nokogiri::XML(response.body)
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").size
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").size
end
end