mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
made support test schema domain version 1.2
This commit is contained in:
parent
ae6bad3e73
commit
4c5e4d7898
41 changed files with 967 additions and 451 deletions
|
@ -10,10 +10,10 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:info>
|
||||
</info>
|
||||
|
@ -30,28 +30,28 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
assert assert_schema_is_bigger(response_xml, 'domain-ee', 1.1)
|
||||
assert_equal 'shop.test',
|
||||
response_xml.at_xpath('//domain:name',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_equal 'ok',
|
||||
response_xml.at_xpath('//domain:status',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s)['s']
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s)['s']
|
||||
assert_equal 'john-001',
|
||||
response_xml.at_xpath('//domain:registrant',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_equal '2010-07-05T00:00:00+03:00',
|
||||
response_xml.at_xpath('//domain:crDate',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_equal '2010-07-06T00:00:00+03:00',
|
||||
response_xml.at_xpath('//domain:upDate',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_equal '2010-07-07T00:00:00+03:00',
|
||||
response_xml.at_xpath('//domain:exDate',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
end
|
||||
|
||||
def test_return_wrong_schema_with_invalid_version
|
||||
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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.0')}">
|
||||
|
@ -71,7 +71,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
def test_return_valid_response_if_specify_the_version
|
||||
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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
|
@ -88,6 +88,27 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
||||
def test_return_valid_response_if_specify_the_version_1_2
|
||||
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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:info>
|
||||
</info>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
p request_xml
|
||||
post epp_info_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
assert_epp_response :completed_successfully
|
||||
end
|
||||
|
||||
def test_returns_valid_response_if_schema_version_is_previous
|
||||
dispute = disputes(:expired)
|
||||
dispute.update!(starts_at: Time.zone.now, expires_at: Time.zone.now + 5.days, closed: nil)
|
||||
|
@ -103,7 +124,7 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-eis', for_version: '1.0')}">
|
||||
|
@ -140,10 +161,10 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:info>
|
||||
</info>
|
||||
|
@ -168,10 +189,10 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:info>
|
||||
</info>
|
||||
|
@ -192,10 +213,10 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
</domain:info>
|
||||
</info>
|
||||
|
@ -209,7 +230,7 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '65078d5',
|
||||
response_xml.at_xpath('//domain:authInfo/domain:pw',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_correct_against_schema response_xml
|
||||
end
|
||||
|
||||
|
@ -220,10 +241,10 @@ class EppDomainInfoBaseTest < 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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw>65078d5</domain:pw>
|
||||
|
@ -240,17 +261,17 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '65078d5',
|
||||
response_xml.at_xpath('//domain:authInfo/domain:pw',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text
|
||||
assert_correct_against_schema response_xml
|
||||
end
|
||||
|
||||
def test_conceals_transfer_code_when_domain_is_not_owned_by_current_user
|
||||
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>
|
||||
<info>
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee')}">
|
||||
<domain:info xmlns:domain="#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}">
|
||||
<domain:name>shop.test</domain:name>
|
||||
<domain:authInfo>
|
||||
<domain:pw></domain:pw>
|
||||
|
@ -267,6 +288,6 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_correct_against_schema response_xml
|
||||
assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw',
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s)
|
||||
'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue