Fail earlier if domain is non-transferable

Regardless of EPP transfer operation

#694
This commit is contained in:
Artur Beljajev 2018-02-19 02:04:39 +02:00
parent 126428f38f
commit 4ada9d1bd0
5 changed files with 44 additions and 8 deletions

View file

@ -1,7 +1,30 @@
require 'test_helper'
class EppDomainTransferBaseTest < ActionDispatch::IntegrationTest
def test_does_not_transfer_if_transfer_code_is_wrong
def test_non_transferable_domain
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>non-transferable.test</domain:name>
<domain:authInfo>
<domain:pw>d382682</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 '2304', Nokogiri::XML(response.body).at_css('result')[:code]
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">