Make legal document optional on domain delete

This commit is contained in:
Alex Sherman 2020-07-01 18:06:21 +05:00
parent 48ac443473
commit 16e9966d34
3 changed files with 4 additions and 35 deletions

View file

@ -160,8 +160,9 @@ class EppDomainDeleteBaseTest < EppTestCase
assert_epp_response :completed_successfully
end
def test_legal_document_is_required_if_mandatory
def test_legal_document_is_optional
assert_equal 'shop.test', @domain.name
Setting.request_confirmation_on_domain_deletion_enabled = false
request_xml = <<-XML
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
@ -178,35 +179,6 @@ class EppDomainDeleteBaseTest < EppTestCase
post epp_delete_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
assert_epp_response :required_parameter_missing
end
def test_legal_document_is_not_required_if_not_mandatory
assert_equal 'shop.test', @domain.name
Setting.request_confirmation_on_domain_deletion_enabled = true
@domain.registrar.legaldoc_optout = true
@domain.registrar.save(validate: false)
@domain.registrar.reload
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>
<delete>
<domain:delete verified="yes" xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
<domain:name>shop.test</domain:name>
</domain:delete>
</delete>
</command>
</epp>
XML
post epp_delete_path, params: { frame: request_xml }, headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
@domain.reload
assert_not @domain.registrant_verification_asked?
assert_not @domain.pending_delete_confirmation?
assert_no_emails
assert_epp_response :completed_successfully
end