mirror of
https://github.com/internetee/registry.git
synced 2025-05-17 09:57:23 +02:00
Merge branch 'master' into registry-480
This commit is contained in:
commit
e2278b0ae9
2 changed files with 47 additions and 0 deletions
|
@ -135,6 +135,16 @@ class EppController < ApplicationController
|
||||||
@errors += obj.errors[:epp_errors]
|
@errors += obj.errors[:epp_errors]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if params[:parsed_frame].at_css('update')
|
||||||
|
@errors.each_with_index do |errors, index|
|
||||||
|
if errors[:code] == '2304' &&
|
||||||
|
errors[:value][:val] == DomainStatus::SERVER_DELETE_PROHIBITED &&
|
||||||
|
errors[:value][:obj] == 'status'
|
||||||
|
@errors[index][:value][:val] = DomainStatus::PENDING_UPDATE
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# for debugging
|
# for debugging
|
||||||
if @errors.blank?
|
if @errors.blank?
|
||||||
@errors << {
|
@errors << {
|
||||||
|
|
37
spec/requests/epp/domain/update/status_spec.rb
Normal file
37
spec/requests/epp/domain/update/status_spec.rb
Normal file
|
@ -0,0 +1,37 @@
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe 'EPP domain:update' do
|
||||||
|
let(:request) { post '/epp/command/update', frame: request_xml }
|
||||||
|
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>
|
||||||
|
<update>
|
||||||
|
<domain:update xmlns:domain="https://epp.tld.ee/schema/domain-eis-1.0.xsd">
|
||||||
|
<domain:name>test.com</domain:name>
|
||||||
|
</domain:update>
|
||||||
|
</update>
|
||||||
|
</command>
|
||||||
|
</epp>
|
||||||
|
XML
|
||||||
|
}
|
||||||
|
|
||||||
|
before :example do
|
||||||
|
sign_in_to_epp_area
|
||||||
|
end
|
||||||
|
|
||||||
|
context 'when domain has both SERVER_DELETE_PROHIBITED and PENDING_UPDATE statuses' do
|
||||||
|
let!(:domain) { create(:domain,
|
||||||
|
name: 'test.com',
|
||||||
|
statuses: [DomainStatus::SERVER_DELETE_PROHIBITED,
|
||||||
|
DomainStatus::PENDING_UPDATE])
|
||||||
|
}
|
||||||
|
|
||||||
|
it 'returns PENDING_UPDATE as domain status' do
|
||||||
|
request
|
||||||
|
status = Nokogiri::XML(response.body).at_xpath('//domain:status',
|
||||||
|
domain: 'https://epp.tld.ee/schema/domain-eis-1.0.xsd').content
|
||||||
|
expect(status).to eq(DomainStatus::PENDING_UPDATE)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
Loading…
Add table
Add a link
Reference in a new issue