mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 09:43:36 +02:00
Return correct error code when adding invalid status
This commit is contained in:
parent
3f4f7ac513
commit
aa56fa3160
2 changed files with 14 additions and 1 deletions
|
@ -133,7 +133,7 @@ class Domain < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
unless DomainStatus::STATUSES.include?(x[:value])
|
unless DomainStatus::STATUSES.include?(x[:value])
|
||||||
add_epp_error('2302', 'status', x[:value], [:domain_statuses, :not_found])
|
add_epp_error('2303', 'status', x[:value], [:domain_statuses, :not_found])
|
||||||
next
|
next
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -501,6 +501,19 @@ describe 'EPP Domain', epp: true do
|
||||||
expect(d.auth_info).to eq('2BARfoo')
|
expect(d.auth_info).to eq('2BARfoo')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'does not assign invalid status to domain' do
|
||||||
|
xml = domain_update_xml({
|
||||||
|
add: [
|
||||||
|
status: { value: '', attrs: { s: 'invalidStatus' } }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
|
response = epp_request(xml, :xml)
|
||||||
|
expect(response[:results][0][:result_code]).to eq('2303')
|
||||||
|
expect(response[:results][0][:msg]).to eq('Status was not found')
|
||||||
|
expect(response[:results][0][:value]).to eq('invalidStatus')
|
||||||
|
end
|
||||||
|
|
||||||
it 'deletes domain' do
|
it 'deletes domain' do
|
||||||
expect(DomainContact.count).to eq(1)
|
expect(DomainContact.count).to eq(1)
|
||||||
response = epp_request(domain_delete_xml, :xml)
|
response = epp_request(domain_delete_xml, :xml)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue