mirror of
https://github.com/internetee/registry.git
synced 2025-07-23 11:16:00 +02:00
updated tests
This commit is contained in:
parent
49fc79244f
commit
825f813437
17 changed files with 154 additions and 154 deletions
|
@ -7,7 +7,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<domain:name>some.test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
|
@ -21,7 +21,7 @@ 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', for_version: '1.1')}").text
|
||||
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}").text
|
||||
end
|
||||
|
||||
def test_domain_is_available_when_not_registered_or_blocked
|
||||
|
@ -30,7 +30,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<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', 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')}")
|
||||
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['avail']
|
||||
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")
|
||||
end
|
||||
|
||||
def test_domain_is_available_when_reserved
|
||||
|
@ -55,7 +55,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<domain:name>reserved.test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
|
@ -68,8 +68,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', 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')}")
|
||||
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['avail']
|
||||
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_format_is_invalid
|
||||
|
@ -78,7 +78,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<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', 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
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['avail']
|
||||
assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}").text
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_registered
|
||||
|
@ -103,7 +103,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<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', 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
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['avail']
|
||||
assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}").text
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_blocked
|
||||
|
@ -128,7 +128,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<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', 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
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['avail']
|
||||
assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}").text
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_zone_with_the_same_origin_exists
|
||||
|
@ -153,7 +153,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<domain:name>test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
|
@ -166,8 +166,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', 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
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}")['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.2')}").text
|
||||
end
|
||||
|
||||
def test_multiple_domains
|
||||
|
@ -176,7 +176,7 @@ class EppDomainCheckBaseTest < EppTestCase
|
|||
<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', for_version: '1.1')}">
|
||||
<domain:check xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<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', for_version: '1.1')}").size
|
||||
assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}").size
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue