mirror of
https://github.com/internetee/registry.git
synced 2025-05-21 03:39:40 +02:00
Refactor complext dnskeys method
This commit is contained in:
parent
a1c2dc2175
commit
a74e2e5fd1
4 changed files with 75 additions and 25 deletions
|
@ -509,7 +509,6 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'creates domain with ds data' do
|
||||
pending true
|
||||
xml = domain_create_xml({}, {
|
||||
_other: [
|
||||
{ dsData: {
|
||||
|
@ -553,7 +552,7 @@ describe 'EPP Domain', epp: true do
|
|||
}]
|
||||
})
|
||||
|
||||
r = epp_request(xml, :xml)
|
||||
epp_request(xml, :xml)
|
||||
|
||||
d = Domain.first
|
||||
ds = d.dnskeys.first
|
||||
|
@ -567,6 +566,33 @@ describe 'EPP Domain', epp: true do
|
|||
expect(ds.public_key).to eq('700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f')
|
||||
end
|
||||
|
||||
it 'does not create domain with ds data when it is not allowed' do
|
||||
sg = SettingGroup.dnskeys
|
||||
s = sg.setting(Setting::ALLOW_DS_DATA_WITH_KEYS)
|
||||
s.value = 0
|
||||
s.save
|
||||
|
||||
xml = domain_create_xml({}, {
|
||||
_other: [
|
||||
{ dsData: {
|
||||
keyTag: { value: '12345' },
|
||||
alg: { value: '3' },
|
||||
digestType: { value: '1' },
|
||||
digest: { value: '49FD46E6C4B45C55D4AC' },
|
||||
keyData: {
|
||||
flags: { value: '0' },
|
||||
protocol: { value: '3' },
|
||||
alg: { value: '5' },
|
||||
pubKey: { value: '700b97b591ed27ec2590d19f06f88bba700b97b591ed27ec2590d19f' }
|
||||
}
|
||||
}
|
||||
}]
|
||||
})
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
expect(response[:result_code]).to eq('2306')
|
||||
expect(response[:msg]).to eq('dsData object with key data is not allowed')
|
||||
end
|
||||
end
|
||||
|
||||
context 'with juridical persion as an owner' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue