Updated domain pending delete

This commit is contained in:
Priit Tark 2015-05-18 17:26:35 +03:00
parent 6f59824cd1
commit 897a10f47b
3 changed files with 21 additions and 2 deletions

View file

@ -84,8 +84,7 @@ class Registrar::DomainsController < Registrar::DeppController # EPP controller
@data = @domain.delete(params[:domain]) @data = @domain.delete(params[:domain])
@results = @data.css('result') @results = @data.css('result')
if response_ok? if response_ok?
params[:domain_name] = nil redirect_to info_registrar_domains_url(domain_name: params[:domain][:name])
render 'info_index'
else else
params[:domain_name] = params[:domain][:name] params[:domain_name] = params[:domain][:name]
render 'delete' render 'delete'

View file

@ -411,6 +411,8 @@ class Epp::Domain < Domain
end end
def epp_destroy(frame) def epp_destroy(frame)
return false unless valid?
if frame.css('delete').attr('verified').to_s.downcase != 'yes' if frame.css('delete').attr('verified').to_s.downcase != 'yes'
registrant_verification_asked! registrant_verification_asked!
pending_delete! pending_delete!

View file

@ -2115,6 +2115,24 @@ describe 'EPP Domain', epp: true do
response[:msg].should == 'Domain status prohibits operation' response[:msg].should == 'Domain status prohibits operation'
end end
it 'does not delete domain with pending delete' do
domain.domain_statuses.create(value: DomainStatus::PENDING_DELETE)
response = epp_plain_request(@epp_xml.domain.delete({
name: { value: domain.name }
}, {
_anonymus: [
legalDocument: {
value: 'JVBERi0xLjQKJcOkw7zDtsOfCjIgMCBvYmoKPDwvTGVuZ3RoIDMgMCBSL0Zp==',
attrs: { type: 'pdf' }
}
]
}), :xml)
response[:msg].should == 'Object status prohibits operation'
response[:result_code].should == '2304'
end
it 'does not delete domain without legal document' do it 'does not delete domain without legal document' do
response = epp_plain_request(@epp_xml.domain.delete(name: { value: 'example.ee' }), :xml) response = epp_plain_request(@epp_xml.domain.delete(name: { value: 'example.ee' }), :xml)
response[:result_code].should == '2003' response[:result_code].should == '2003'