mirror of
https://github.com/internetee/registry.git
synced 2025-05-30 09:30:03 +02:00
Update epp-xml gem
This commit is contained in:
parent
a3b359a47b
commit
5cdab8faa7
3 changed files with 33 additions and 22 deletions
2
Gemfile
2
Gemfile
|
@ -85,7 +85,7 @@ group :development, :test do
|
||||||
gem 'epp', '~> 1.4.0'
|
gem 'epp', '~> 1.4.0'
|
||||||
|
|
||||||
# EPP XMLs
|
# EPP XMLs
|
||||||
gem 'epp-xml'
|
gem 'epp-xml', '~> 0.1.0'
|
||||||
|
|
||||||
# Replacement for fixtures
|
# Replacement for fixtures
|
||||||
gem 'fabrication', '~> 2.11.3'
|
gem 'fabrication', '~> 2.11.3'
|
||||||
|
|
|
@ -93,7 +93,7 @@ GEM
|
||||||
epp (1.4.0)
|
epp (1.4.0)
|
||||||
hpricot
|
hpricot
|
||||||
libxml-ruby
|
libxml-ruby
|
||||||
epp-xml (0.0.2)
|
epp-xml (0.1.0)
|
||||||
activesupport (~> 4.1)
|
activesupport (~> 4.1)
|
||||||
builder (~> 3.2)
|
builder (~> 3.2)
|
||||||
equalizer (0.0.9)
|
equalizer (0.0.9)
|
||||||
|
@ -362,7 +362,7 @@ DEPENDENCIES
|
||||||
database_cleaner (~> 1.3.0)
|
database_cleaner (~> 1.3.0)
|
||||||
devise (~> 3.3.0)
|
devise (~> 3.3.0)
|
||||||
epp (~> 1.4.0)
|
epp (~> 1.4.0)
|
||||||
epp-xml
|
epp-xml (~> 0.1.0)
|
||||||
fabrication (~> 2.11.3)
|
fabrication (~> 2.11.3)
|
||||||
faker (~> 1.3.0)
|
faker (~> 1.3.0)
|
||||||
guard (~> 2.6.1)
|
guard (~> 2.6.1)
|
||||||
|
|
|
@ -217,7 +217,7 @@ describe 'EPP Domain', epp: true do
|
||||||
xml = EppXml::Domain.create({
|
xml = EppXml::Domain.create({
|
||||||
name: { value: 'ria.ee' }
|
name: { value: 'ria.ee' }
|
||||||
}, {
|
}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ keyData: {
|
{ keyData: {
|
||||||
flags: { value: '257' },
|
flags: { value: '257' },
|
||||||
protocol: { value: '3' },
|
protocol: { value: '3' },
|
||||||
|
@ -352,7 +352,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'creates a domain with multiple dnskeys' do
|
it 'creates a domain with multiple dnskeys' do
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ keyData: {
|
{ keyData: {
|
||||||
flags: { value: '257' },
|
flags: { value: '257' },
|
||||||
protocol: { value: '3' },
|
protocol: { value: '3' },
|
||||||
|
@ -402,7 +402,7 @@ describe 'EPP Domain', epp: true do
|
||||||
it 'does not create a domain when dnskeys are invalid' do
|
it 'does not create a domain when dnskeys are invalid' do
|
||||||
|
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ keyData: {
|
{ keyData: {
|
||||||
flags: { value: '250' },
|
flags: { value: '250' },
|
||||||
protocol: { value: '4' },
|
protocol: { value: '4' },
|
||||||
|
@ -454,7 +454,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'does not create a domain with two identical dnskeys' do
|
it 'does not create a domain with two identical dnskeys' do
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ keyData: {
|
{ keyData: {
|
||||||
flags: { value: '257' },
|
flags: { value: '257' },
|
||||||
protocol: { value: '3' },
|
protocol: { value: '3' },
|
||||||
|
@ -483,7 +483,7 @@ describe 'EPP Domain', epp: true do
|
||||||
Setting.dnskeys_max_count = 1
|
Setting.dnskeys_max_count = 1
|
||||||
|
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ keyData: {
|
{ keyData: {
|
||||||
flags: { value: '257' },
|
flags: { value: '257' },
|
||||||
protocol: { value: '3' },
|
protocol: { value: '3' },
|
||||||
|
@ -509,7 +509,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'creates domain with ds data' do
|
it 'creates domain with ds data' do
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ dsData: {
|
{ dsData: {
|
||||||
keyTag: { value: '12345' },
|
keyTag: { value: '12345' },
|
||||||
alg: { value: '3' },
|
alg: { value: '3' },
|
||||||
|
@ -535,7 +535,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'creates domain with ds data with key' do
|
it 'creates domain with ds data with key' do
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ dsData: {
|
{ dsData: {
|
||||||
keyTag: { value: '12345' },
|
keyTag: { value: '12345' },
|
||||||
alg: { value: '3' },
|
alg: { value: '3' },
|
||||||
|
@ -569,7 +569,7 @@ describe 'EPP Domain', epp: true do
|
||||||
Setting.ds_data_with_key_allowed = false
|
Setting.ds_data_with_key_allowed = false
|
||||||
|
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ dsData: {
|
{ dsData: {
|
||||||
keyTag: { value: '12345' },
|
keyTag: { value: '12345' },
|
||||||
alg: { value: '3' },
|
alg: { value: '3' },
|
||||||
|
@ -594,7 +594,7 @@ describe 'EPP Domain', epp: true do
|
||||||
Setting.ds_data_allowed = false
|
Setting.ds_data_allowed = false
|
||||||
|
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ dsData: {
|
{ dsData: {
|
||||||
keyTag: { value: '12345' },
|
keyTag: { value: '12345' },
|
||||||
alg: { value: '3' },
|
alg: { value: '3' },
|
||||||
|
@ -619,7 +619,7 @@ describe 'EPP Domain', epp: true do
|
||||||
Setting.key_data_allowed = false
|
Setting.key_data_allowed = false
|
||||||
|
|
||||||
xml = EppXml::Domain.create({}, {
|
xml = EppXml::Domain.create({}, {
|
||||||
_other: [
|
_anonymus: [
|
||||||
keyData: {
|
keyData: {
|
||||||
flags: { value: '0' },
|
flags: { value: '0' },
|
||||||
protocol: { value: '3' },
|
protocol: { value: '3' },
|
||||||
|
@ -643,7 +643,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'creates a domain with contacts' do
|
it 'creates a domain with contacts' do
|
||||||
xml = EppXml::Domain.create({
|
xml = EppXml::Domain.create({
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ contact: { value: 'sh8013', attrs: { type: 'admin' } } }
|
{ contact: { value: 'sh8013', attrs: { type: 'admin' } } }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -662,7 +662,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'does not create a domain without admin contact' do
|
it 'does not create a domain without admin contact' do
|
||||||
xml = EppXml::Domain.create({
|
xml = EppXml::Domain.create({
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ contact: { value: 'sh8013', attrs: { type: 'tech' } } }
|
{ contact: { value: 'sh8013', attrs: { type: 'tech' } } }
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -818,7 +818,7 @@ describe 'EPP Domain', epp: true do
|
||||||
{ hostObj: { value: 'ns2.example.com' } }
|
{ hostObj: { value: 'ns2.example.com' } }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
||||||
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
|
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
|
||||||
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
|
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
|
||||||
|
@ -901,7 +901,7 @@ describe 'EPP Domain', epp: true do
|
||||||
{ hostObj: { value: 'ns2.example.com' } }
|
{ hostObj: { value: 'ns2.example.com' } }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
||||||
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
|
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
|
||||||
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
|
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
|
||||||
|
@ -938,7 +938,7 @@ describe 'EPP Domain', epp: true do
|
||||||
{ hostObj: { value: 'ns1.example.com' } }
|
{ hostObj: { value: 'ns1.example.com' } }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
_other: [
|
_anonymus: [
|
||||||
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
|
||||||
{ status: { value: '', attrs: { s: 'clientHold' } } }
|
{ status: { value: '', attrs: { s: 'clientHold' } } }
|
||||||
]
|
]
|
||||||
|
@ -1049,7 +1049,7 @@ describe 'EPP Domain', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'checks a domain' do
|
it 'checks a domain' do
|
||||||
response = epp_request(domain_check_xml, :xml)
|
response = epp_request(EppXml::Domain.check, :xml)
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
expect(response[:msg]).to eq('Command completed successfully')
|
expect(response[:msg]).to eq('Command completed successfully')
|
||||||
|
|
||||||
|
@ -1059,7 +1059,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
Fabricate(:domain, name: 'example.ee', registrar: zone)
|
Fabricate(:domain, name: 'example.ee', registrar: zone)
|
||||||
|
|
||||||
response = epp_request(domain_check_xml, :xml)
|
response = epp_request(EppXml::Domain.check, :xml)
|
||||||
domain = response[:parsed].css('resData chkData cd').first
|
domain = response[:parsed].css('resData chkData cd').first
|
||||||
name = domain.css('name').first
|
name = domain.css('name').first
|
||||||
reason = domain.css('reason').first
|
reason = domain.css('reason').first
|
||||||
|
@ -1070,7 +1070,13 @@ describe 'EPP Domain', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'checks multiple domains' do
|
it 'checks multiple domains' do
|
||||||
xml = domain_check_xml(names: ['one.ee', 'two.ee', 'three.ee'])
|
xml = EppXml::Domain.check({
|
||||||
|
_anonymus: [
|
||||||
|
{ name: { value: 'one.ee' } },
|
||||||
|
{ name: { value: 'two.ee' } },
|
||||||
|
{ name: { value: 'three.ee' } }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
response = epp_request(xml, :xml)
|
response = epp_request(xml, :xml)
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
|
@ -1086,7 +1092,12 @@ describe 'EPP Domain', epp: true do
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'checks invalid format domain' do
|
it 'checks invalid format domain' do
|
||||||
xml = domain_check_xml(names: ['one.ee', 'notcorrectdomain'])
|
xml = EppXml::Domain.check({
|
||||||
|
_anonymus: [
|
||||||
|
{ name: { value: 'one.ee' } },
|
||||||
|
{ name: { value: 'notcorrectdomain' } }
|
||||||
|
]
|
||||||
|
})
|
||||||
|
|
||||||
response = epp_request(xml, :xml)
|
response = epp_request(xml, :xml)
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue