mirror of
https://github.com/internetee/registry.git
synced 2025-07-21 18:26:06 +02:00
parent
4ada9d1bd0
commit
36f65a267c
3 changed files with 51 additions and 43 deletions
|
@ -24,29 +24,6 @@ class EppDomainTransferBaseTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal '2304', Nokogiri::XML(response.body).at_css('result')[:code]
|
assert_equal '2304', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_wrong_transfer_code
|
|
||||||
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>
|
|
||||||
<transfer op="query">
|
|
||||||
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
|
||||||
<domain:name>shop.test</domain:name>
|
|
||||||
<domain:authInfo>
|
|
||||||
<domain:pw>wrong</domain:pw>
|
|
||||||
</domain:authInfo>
|
|
||||||
</domain:transfer>
|
|
||||||
</transfer>
|
|
||||||
</command>
|
|
||||||
</epp>
|
|
||||||
XML
|
|
||||||
|
|
||||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
|
||||||
domains(:shop).reload
|
|
||||||
assert_equal registrars(:bestnames), domains(:shop).registrar
|
|
||||||
assert_equal '2201', Nokogiri::XML(response.body).at_css('result')[:code]
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_non_existent_domain
|
def test_non_existent_domain
|
||||||
request_xml = <<-XML
|
request_xml = <<-XML
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
|
|
@ -2,22 +2,6 @@ require 'test_helper'
|
||||||
|
|
||||||
class EppDomainTransferQueryTest < ActionDispatch::IntegrationTest
|
class EppDomainTransferQueryTest < ActionDispatch::IntegrationTest
|
||||||
def test_returns_domain_transfer_details
|
def test_returns_domain_transfer_details
|
||||||
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>
|
|
||||||
<transfer op="query">
|
|
||||||
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
|
||||||
<domain:name>shop.test</domain:name>
|
|
||||||
<domain:authInfo>
|
|
||||||
<domain:pw>65078d5</domain:pw>
|
|
||||||
</domain:authInfo>
|
|
||||||
</domain:transfer>
|
|
||||||
</transfer>
|
|
||||||
</command>
|
|
||||||
</epp>
|
|
||||||
XML
|
|
||||||
|
|
||||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
xml_doc = Nokogiri::XML(response.body)
|
xml_doc = Nokogiri::XML(response.body)
|
||||||
assert_equal '1000', xml_doc.at_css('result')[:code]
|
assert_equal '1000', xml_doc.at_css('result')[:code]
|
||||||
|
@ -28,10 +12,37 @@ class EppDomainTransferQueryTest < ActionDispatch::IntegrationTest
|
||||||
assert_equal 'bestnames', xml_doc.xpath('//domain:acID', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
assert_equal 'bestnames', xml_doc.xpath('//domain:acID', 'domain' => 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').text
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_wrong_transfer_code
|
||||||
|
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>
|
||||||
|
<transfer op="query">
|
||||||
|
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||||
|
<domain:name>shop.test</domain:name>
|
||||||
|
<domain:authInfo>
|
||||||
|
<domain:pw>wrong</domain:pw>
|
||||||
|
</domain:authInfo>
|
||||||
|
</domain:transfer>
|
||||||
|
</transfer>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
assert_equal '2201', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
|
end
|
||||||
|
|
||||||
def test_no_domain_transfer
|
def test_no_domain_transfer
|
||||||
domains(:shop).domain_transfers.delete_all
|
domains(:shop).domain_transfers.delete_all
|
||||||
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
assert_equal '2303', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
|
end
|
||||||
|
|
||||||
request_xml = <<-XML
|
private
|
||||||
|
|
||||||
|
def request_xml
|
||||||
|
<<-XML
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
<epp xmlns="https://epp.tld.ee/schema/epp-ee-1.0.xsd">
|
||||||
<command>
|
<command>
|
||||||
|
@ -46,8 +57,5 @@ class EppDomainTransferQueryTest < ActionDispatch::IntegrationTest
|
||||||
</command>
|
</command>
|
||||||
</epp>
|
</epp>
|
||||||
XML
|
XML
|
||||||
|
|
||||||
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
|
||||||
assert_equal '2303', Nokogiri::XML(response.body).at_css('result')[:code]
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -53,6 +53,29 @@ class EppDomainTransferRequestTest < ActionDispatch::IntegrationTest
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_wrong_transfer_code
|
||||||
|
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>
|
||||||
|
<transfer op="request">
|
||||||
|
<domain:transfer xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||||
|
<domain:name>shop.test</domain:name>
|
||||||
|
<domain:authInfo>
|
||||||
|
<domain:pw>wrong</domain:pw>
|
||||||
|
</domain:authInfo>
|
||||||
|
</domain:transfer>
|
||||||
|
</transfer>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
|
||||||
|
post '/epp/command/transfer', { frame: request_xml }, { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||||
|
domains(:shop).reload
|
||||||
|
assert_equal registrars(:bestnames), domains(:shop).registrar
|
||||||
|
assert_equal '2201', Nokogiri::XML(response.body).at_css('result')[:code]
|
||||||
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def request_xml
|
def request_xml
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue