mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Merge branch 'master' of github.com:internetee/registry
This commit is contained in:
commit
785ac5450f
2 changed files with 12 additions and 3 deletions
|
@ -61,6 +61,7 @@ module Epp
|
||||||
## UPDATE
|
## UPDATE
|
||||||
def validate_contact_update_request
|
def validate_contact_update_request
|
||||||
@ph = params_hash['epp']['command']['update']['update']
|
@ph = params_hash['epp']['command']['update']['update']
|
||||||
|
update_attrs_present?
|
||||||
xml_attrs_present?(@ph, [['id']])
|
xml_attrs_present?(@ph, [['id']])
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -70,6 +71,13 @@ module Epp
|
||||||
value: { obj: 'id', val: code } }
|
value: { obj: 'id', val: code } }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def update_attrs_present?
|
||||||
|
return true if parsed_frame.css('add').present?
|
||||||
|
return true if parsed_frame.css('rem').present?
|
||||||
|
return true if parsed_frame.css('chg').present?
|
||||||
|
epp_errors << { code: '2003', msg: I18n.t('errors.messages.required_parameter_missing', key: 'add, rem or chg') }
|
||||||
|
end
|
||||||
|
|
||||||
## DELETE
|
## DELETE
|
||||||
def validate_contact_delete_request
|
def validate_contact_delete_request
|
||||||
@ph = params_hash['epp']['command']['delete']['delete']
|
@ph = params_hash['epp']['command']['delete']['delete']
|
||||||
|
|
|
@ -84,11 +84,12 @@ describe 'EPP Contact', epp: true do
|
||||||
context 'update command' do
|
context 'update command' do
|
||||||
it 'fails if request is invalid' do
|
it 'fails if request is invalid' do
|
||||||
response = epp_request('contacts/update_missing_attr.xml')
|
response = epp_request('contacts/update_missing_attr.xml')
|
||||||
# response = epp_request(contact_update_xml( {id: false} ), :xml)
|
|
||||||
|
|
||||||
expect(response[:results][0][:result_code]).to eq('2003')
|
expect(response[:results][0][:result_code]).to eq('2003')
|
||||||
expect(response[:results][0][:msg]).to eq('Required parameter missing: id')
|
expect(response[:results][0][:msg]).to eq('Required parameter missing: add, rem or chg')
|
||||||
expect(response[:results].count).to eq 1
|
expect(response[:results][1][:result_code]).to eq('2003')
|
||||||
|
expect(response[:results][1][:msg]).to eq('Required parameter missing: id')
|
||||||
|
expect(response[:results].count).to eq 2
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'fails with wrong authentication info' do
|
it 'fails with wrong authentication info' do
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue