mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 20:55:44 +02:00
Make legal document optional on domain delete
This commit is contained in:
parent
48ac443473
commit
16e9966d34
3 changed files with 4 additions and 35 deletions
|
@ -256,9 +256,6 @@ module Epp
|
|||
end
|
||||
|
||||
def validate_delete
|
||||
# binding.pry
|
||||
requires 'extension > extdata > legalDocument' if current_user.legaldoc_mandatory?
|
||||
|
||||
@prefix = 'delete > delete >'
|
||||
requires 'name'
|
||||
end
|
||||
|
|
|
@ -14,10 +14,10 @@
|
|||
|
||||
.form-group
|
||||
.col-md-4.control-label
|
||||
= label_tag 'domain[legal_document]', t(:legal_document), class: ('required' if current_registrar_user.legaldoc_mandatory?)
|
||||
= label_tag 'domain[legal_document]', t(:legal_document)
|
||||
%p.help-block= t(:legal_document_max_size)
|
||||
.col-md-6
|
||||
= file_field_tag 'domain[legal_document]', required: current_registrar_user.legaldoc_mandatory?
|
||||
= file_field_tag 'domain[legal_document]'
|
||||
= hidden_field_tag 'domain[name]', params[:domain_name]
|
||||
%hr
|
||||
.row
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue