Update epp-xml gem

This commit is contained in:
Martin Lensment 2014-10-24 17:14:15 +03:00
parent a3b359a47b
commit 5cdab8faa7
3 changed files with 33 additions and 22 deletions

View file

@ -85,7 +85,7 @@ group :development, :test do
gem 'epp', '~> 1.4.0'
# EPP XMLs
gem 'epp-xml'
gem 'epp-xml', '~> 0.1.0'
# Replacement for fixtures
gem 'fabrication', '~> 2.11.3'

View file

@ -93,7 +93,7 @@ GEM
epp (1.4.0)
hpricot
libxml-ruby
epp-xml (0.0.2)
epp-xml (0.1.0)
activesupport (~> 4.1)
builder (~> 3.2)
equalizer (0.0.9)
@ -362,7 +362,7 @@ DEPENDENCIES
database_cleaner (~> 1.3.0)
devise (~> 3.3.0)
epp (~> 1.4.0)
epp-xml
epp-xml (~> 0.1.0)
fabrication (~> 2.11.3)
faker (~> 1.3.0)
guard (~> 2.6.1)

View file

@ -217,7 +217,7 @@ describe 'EPP Domain', epp: true do
xml = EppXml::Domain.create({
name: { value: 'ria.ee' }
}, {
_other: [
_anonymus: [
{ keyData: {
flags: { value: '257' },
protocol: { value: '3' },
@ -352,7 +352,7 @@ describe 'EPP Domain', epp: true do
it 'creates a domain with multiple dnskeys' do
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ keyData: {
flags: { value: '257' },
protocol: { value: '3' },
@ -402,7 +402,7 @@ describe 'EPP Domain', epp: true do
it 'does not create a domain when dnskeys are invalid' do
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ keyData: {
flags: { value: '250' },
protocol: { value: '4' },
@ -454,7 +454,7 @@ describe 'EPP Domain', epp: true do
it 'does not create a domain with two identical dnskeys' do
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ keyData: {
flags: { value: '257' },
protocol: { value: '3' },
@ -483,7 +483,7 @@ describe 'EPP Domain', epp: true do
Setting.dnskeys_max_count = 1
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ keyData: {
flags: { value: '257' },
protocol: { value: '3' },
@ -509,7 +509,7 @@ describe 'EPP Domain', epp: true do
it 'creates domain with ds data' do
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ dsData: {
keyTag: { value: '12345' },
alg: { value: '3' },
@ -535,7 +535,7 @@ describe 'EPP Domain', epp: true do
it 'creates domain with ds data with key' do
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ dsData: {
keyTag: { value: '12345' },
alg: { value: '3' },
@ -569,7 +569,7 @@ describe 'EPP Domain', epp: true do
Setting.ds_data_with_key_allowed = false
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ dsData: {
keyTag: { value: '12345' },
alg: { value: '3' },
@ -594,7 +594,7 @@ describe 'EPP Domain', epp: true do
Setting.ds_data_allowed = false
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
{ dsData: {
keyTag: { value: '12345' },
alg: { value: '3' },
@ -619,7 +619,7 @@ describe 'EPP Domain', epp: true do
Setting.key_data_allowed = false
xml = EppXml::Domain.create({}, {
_other: [
_anonymus: [
keyData: {
flags: { value: '0' },
protocol: { value: '3' },
@ -643,7 +643,7 @@ describe 'EPP Domain', epp: true do
it 'creates a domain with contacts' do
xml = EppXml::Domain.create({
_other: [
_anonymus: [
{ 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
xml = EppXml::Domain.create({
_other: [
_anonymus: [
{ contact: { value: 'sh8013', attrs: { type: 'tech' } } }
]
})
@ -818,7 +818,7 @@ describe 'EPP Domain', epp: true do
{ hostObj: { value: 'ns2.example.com' } }
]
},
_other: [
_anonymus: [
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
@ -901,7 +901,7 @@ describe 'EPP Domain', epp: true do
{ hostObj: { value: 'ns2.example.com' } }
]
},
_other: [
_anonymus: [
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
{ status: { value: 'Payment overdue.', attrs: { s: 'clientHold', lang: 'en' } } },
{ status: { value: '', attrs: { s: 'clientUpdateProhibited' } } }
@ -938,7 +938,7 @@ describe 'EPP Domain', epp: true do
{ hostObj: { value: 'ns1.example.com' } }
]
},
_other: [
_anonymus: [
{ contact: { value: 'mak21', attrs: { type: 'tech' } } },
{ status: { value: '', attrs: { s: 'clientHold' } } }
]
@ -1049,7 +1049,7 @@ describe 'EPP Domain', epp: true do
end
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[:msg]).to eq('Command completed successfully')
@ -1059,7 +1059,7 @@ describe 'EPP Domain', epp: true do
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
name = domain.css('name').first
reason = domain.css('reason').first
@ -1070,7 +1070,13 @@ describe 'EPP Domain', epp: true do
end
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)
expect(response[:result_code]).to eq('1000')
@ -1086,7 +1092,12 @@ describe 'EPP Domain', epp: true do
end
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)
expect(response[:result_code]).to eq('1000')