Add EPP response code rspec matcher

#355
This commit is contained in:
Artur Beljajev 2017-01-25 05:11:31 +02:00
parent edf1e33260
commit e31c68d43f
6 changed files with 56 additions and 18 deletions

View file

@ -20,10 +20,6 @@ RSpec.describe 'EPP domain:delete' do
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
@ -33,7 +29,7 @@ RSpec.describe 'EPP domain:delete' do
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})"
expect(response).to have_code_of(1001)
end
end
@ -42,7 +38,7 @@ RSpec.describe 'EPP domain:delete' do
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})"
expect(response).to have_code_of(2105)
end
end
end