mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Introduce 'optional' validator to epp controllers
This commit is contained in:
parent
3a529135ea
commit
e6b36c409d
6 changed files with 96 additions and 16 deletions
|
@ -112,6 +112,30 @@ describe 'EPP Keyrelay', epp: true do
|
|||
expect(zone.messages.queued.count).to eq(0)
|
||||
end
|
||||
|
||||
it 'returns an error on invalid absolute expiry' do
|
||||
xml = epp_xml.keyrelay({
|
||||
name: { value: 'example.ee' },
|
||||
keyData: {
|
||||
flags: { value: '256' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '8' },
|
||||
pubKey: { value: 'cmlraXN0aGViZXN0' }
|
||||
},
|
||||
authInfo: {
|
||||
pw: { value: domain.auth_info }
|
||||
},
|
||||
expiry: {
|
||||
absolute: { value: 'Invalid Absolute' }
|
||||
}
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml, :elkdata)
|
||||
expect(response[:msg]).to eq('Expiry absolute must be compatible to ISO 8601')
|
||||
expect(response[:results][0][:value]).to eq('Invalid Absolute')
|
||||
|
||||
expect(zone.messages.queued.count).to eq(0)
|
||||
end
|
||||
|
||||
it 'does not allow both relative and absolute' do
|
||||
xml = epp_xml.keyrelay({
|
||||
name: { value: 'example.ee' },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue