mirror of
https://github.com/internetee/registry.git
synced 2025-08-13 13:09:32 +02:00
Add exception to EppErrors concerning settings
This commit is contained in:
parent
87cc7799be
commit
b42357b26d
3 changed files with 16 additions and 5 deletions
|
@ -28,7 +28,17 @@ module EppErrors
|
||||||
else
|
else
|
||||||
next unless code = find_epp_code(err)
|
next unless code = find_epp_code(err)
|
||||||
err = {code: code, msg: err}
|
err = {code: code, msg: err}
|
||||||
err[:value] = {val: send(key), obj: self.class::EPP_ATTR_MAP[key]} unless self.class.reflect_on_association(key)
|
|
||||||
|
# If we have setting relation, then still add the value to the error message
|
||||||
|
# If this sort of exception happens again, some other logic has to be implemented
|
||||||
|
if self.class.reflect_on_association(key) && key == :setting
|
||||||
|
err[:value] = {val: send(key).value, obj: self.class::EPP_ATTR_MAP[key]}
|
||||||
|
|
||||||
|
#if the key represents other relations, skip value
|
||||||
|
elsif !self.class.reflect_on_association(key)
|
||||||
|
err[:value] = {val: send(key), obj: self.class::EPP_ATTR_MAP[key]}
|
||||||
|
end
|
||||||
|
|
||||||
epp_errors << err
|
epp_errors << err
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -68,9 +68,7 @@ en:
|
||||||
taken: 'Code already exists'
|
taken: 'Code already exists'
|
||||||
domain_status:
|
domain_status:
|
||||||
attributes:
|
attributes:
|
||||||
setting:
|
setting_id:
|
||||||
taken: 'Status already exists on this domain'
|
|
||||||
value:
|
|
||||||
taken: 'Status already exists on this domain'
|
taken: 'Status already exists on this domain'
|
||||||
attributes:
|
attributes:
|
||||||
domain:
|
domain:
|
||||||
|
@ -81,6 +79,7 @@ en:
|
||||||
|
|
||||||
errors:
|
errors:
|
||||||
messages:
|
messages:
|
||||||
|
taken: 'Status already exists on this domain'
|
||||||
blank: 'is missing'
|
blank: 'is missing'
|
||||||
epp_domain_reserved: 'Domain name is reserved or restricted'
|
epp_domain_reserved: 'Domain name is reserved or restricted'
|
||||||
epp_obj_does_not_exist: 'Object does not exist'
|
epp_obj_does_not_exist: 'Object does not exist'
|
||||||
|
|
|
@ -271,9 +271,11 @@ describe 'EPP Domain', epp: true do
|
||||||
expect(d.domain_statuses.last.value).to eq('clientUpdateProhibited')
|
expect(d.domain_statuses.last.value).to eq('clientUpdateProhibited')
|
||||||
|
|
||||||
response = epp_request('domains/update_add_objects.xml')
|
response = epp_request('domains/update_add_objects.xml')
|
||||||
|
|
||||||
expect(response[:results][0][:result_code]).to eq('2302')
|
expect(response[:results][0][:result_code]).to eq('2302')
|
||||||
expect(response[:results][0][:msg]).to eq('Status already exists on this domain')
|
expect(response[:results][0][:msg]).to eq('Status already exists on this domain')
|
||||||
|
expect(response[:results][0][:value]).to eq('clientHold')
|
||||||
|
expect(response[:results][1][:msg]).to eq('Status already exists on this domain')
|
||||||
|
expect(response[:results][1][:value]).to eq('clientUpdateProhibited')
|
||||||
expect(d.domain_statuses.count).to eq(2)
|
expect(d.domain_statuses.count).to eq(2)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue