mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 14:44:47 +02:00
Make domain available when reserved
This commit is contained in:
parent
3772f47613
commit
cad457fb72
3 changed files with 24 additions and 30 deletions
|
@ -23,7 +23,7 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest
|
|||
assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
end
|
||||
|
||||
def test_domain_is_available_when_not_registered_blocked_nor_reserved
|
||||
def test_domain_is_available_when_not_registered_or_blocked
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||
|
@ -44,6 +44,29 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest
|
|||
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')
|
||||
end
|
||||
|
||||
def test_domain_is_available_when_reserved
|
||||
assert_equal 'reserved.test', reserved_domains(:one).name
|
||||
|
||||
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>
|
||||
<check>
|
||||
<domain:check xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>reserved.test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
assert_nil response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_format_is_invalid
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
@ -111,29 +134,6 @@ class EppDomainCheckBaseTest < ApplicationIntegrationTest
|
|||
assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
end
|
||||
|
||||
def test_domain_is_unavailable_when_reserved
|
||||
assert_equal 'reserved.test', reserved_domains(:one).name
|
||||
|
||||
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>
|
||||
<check>
|
||||
<domain:check xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>reserved.test</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
|
||||
post '/epp/command/check', { frame: request_xml }, 'HTTP_COOKIE' => 'session=api_bestnames'
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd')['avail']
|
||||
assert_equal 'Domain name is reserved', response_xml.at_xpath('//domain:reason', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||
end
|
||||
|
||||
def test_multiple_domains
|
||||
request_xml = <<-XML
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue