mirror of
https://github.com/internetee/registry.git
synced 2025-07-24 19:48:28 +02:00
Disallow EPP domain:update/transfer/delete if a domain has "deleteCandidate" status
#355
This commit is contained in:
parent
d4ddb5dc25
commit
edf1e33260
10 changed files with 193 additions and 2 deletions
48
spec/requests/epp/domain/delete/discarded_spec.rb
Normal file
48
spec/requests/epp/domain/delete/discarded_spec.rb
Normal file
|
@ -0,0 +1,48 @@
|
|||
require 'rails_helper'
|
||||
|
||||
RSpec.describe 'EPP domain:delete' do
|
||||
let(: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 xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||
<domain:name>test.com</domain:name>
|
||||
</domain:delete>
|
||||
</delete>
|
||||
<extension>
|
||||
<eis:extdata xmlns:eis="https://epp.tld.ee/schema/eis-1.0.xsd">
|
||||
<eis:legalDocument type="pdf">dGVzdCBmYWlsCg==</eis:legalDocument>
|
||||
</eis:extdata>
|
||||
</extension>
|
||||
</command>
|
||||
</epp>
|
||||
XML
|
||||
}
|
||||
|
||||
subject(:response_xml) { Nokogiri::XML(response.body) }
|
||||
subject(:response_code) { response_xml.xpath('//xmlns:result').first['code'] }
|
||||
subject(:response_description) { response_xml.css('result msg').text }
|
||||
|
||||
before :example do
|
||||
sign_in_to_epp_area
|
||||
end
|
||||
|
||||
context 'when domain is not discarded' do
|
||||
let!(:domain) { create(:domain, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 1001' do
|
||||
post '/epp/command/delete', frame: request_xml
|
||||
expect(response_code).to eq('1001'), "Expected EPP code of 1001, got #{response_code} (#{response_description})"
|
||||
end
|
||||
end
|
||||
|
||||
context 'when domain is discarded' do
|
||||
let!(:domain) { create(:domain_discarded, name: 'test.com') }
|
||||
|
||||
it 'returns epp code of 2105' do
|
||||
post '/epp/command/delete', frame: request_xml
|
||||
expect(response_code).to eq('2105'), "Expected EPP code of 2105, got #{response_code} (#{response_description})"
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue