Fixed contact#info not returning value on failure

This commit is contained in:
Andres Keskküla 2014-08-12 14:52:23 +03:00
parent 2220846b9f
commit 03486c107c
2 changed files with 3 additions and 1 deletions

View file

@ -22,6 +22,7 @@ module Epp::ContactsHelper
end
def delete_contact
#no deleting, implement PaperTrail or something similar.
ph = params_hash['epp']['command']['delete']['delete']
@contact = Contact.where(code: ph[:id]).first
@ -62,7 +63,7 @@ module Epp::ContactsHelper
render 'epp/error'
end
rescue NoMethodError => e
epp_errors << { code: '2303', msg: t('errors.messages.epp_obj_does_not_exist') }
epp_errors << { code: '2303', msg: t('errors.messages.epp_obj_does_not_exist'), value: { obj: 'id', val: ph[:id] } }
render 'epp/error'
end

View file

@ -94,6 +94,7 @@ describe 'EPP Contact', epp: true do
response = epp_request('contacts/info.xml')
expect(response[:result_code]).to eq('2303')
expect(response[:msg]).to eq('Object does not exist')
expect(response[:results][0][:value]).to eq('info-4444')
end
it 'returns info about contact' do