mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Bump renew xml to epp-xml 0.5.0
This commit is contained in:
parent
630cad1978
commit
f970cb4b79
4 changed files with 22 additions and 7 deletions
2
Gemfile
2
Gemfile
|
@ -85,7 +85,7 @@ group :development, :test do
|
|||
gem 'epp', '~> 1.4.0'
|
||||
|
||||
# EPP XMLs
|
||||
gem 'epp-xml', '~> 0.3.0'
|
||||
gem 'epp-xml', '~> 0.5.0'
|
||||
|
||||
# Replacement for fixtures
|
||||
gem 'fabrication', '~> 2.11.3'
|
||||
|
|
|
@ -93,7 +93,7 @@ GEM
|
|||
epp (1.4.0)
|
||||
hpricot
|
||||
libxml-ruby
|
||||
epp-xml (0.3.0)
|
||||
epp-xml (0.5.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 (~> 0.3.0)
|
||||
epp-xml (~> 0.5.0)
|
||||
fabrication (~> 2.11.3)
|
||||
faker (~> 1.3.0)
|
||||
guard (~> 2.6.1)
|
||||
|
|
|
@ -22,7 +22,8 @@ class Epp::EppDomain < Domain
|
|||
[:admin_contacts, :out_of_range],
|
||||
[:base, :ds_data_with_key_not_allowed],
|
||||
[:base, :ds_data_not_allowed],
|
||||
[:base, :key_data_not_allowed]
|
||||
[:base, :key_data_not_allowed],
|
||||
[:period, :not_a_number]
|
||||
],
|
||||
'2004' => [ # Parameter value range error
|
||||
[:nameservers, :out_of_range,
|
||||
|
|
|
@ -682,7 +682,12 @@ describe 'EPP Domain', epp: true do
|
|||
|
||||
it 'renews a domain' do
|
||||
exp_date = (Date.today + 1.year)
|
||||
xml = domain_renew_xml(curExpDate: exp_date.to_s)
|
||||
xml = EppXml::Domain.renew(
|
||||
name: { value: 'example.ee' },
|
||||
curExpDate: { value: exp_date.to_s },
|
||||
period: { value: '1', attrs: { unit: 'y' } }
|
||||
)
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
ex_date = response[:parsed].css('renData exDate').text
|
||||
name = response[:parsed].css('renData name').text
|
||||
|
@ -691,7 +696,11 @@ describe 'EPP Domain', epp: true do
|
|||
end
|
||||
|
||||
it 'returns an error when given and current exp dates do not match' do
|
||||
xml = domain_renew_xml(curExpDate: '2016-08-07')
|
||||
xml = EppXml::Domain.renew(
|
||||
name: { value: 'example.ee' },
|
||||
curExpDate: { value: '2016-08-07' },
|
||||
period: { value: '1', attrs: { unit: 'y' } }
|
||||
)
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
expect(response[:results][0][:result_code]).to eq('2306')
|
||||
|
@ -700,7 +709,12 @@ describe 'EPP Domain', epp: true do
|
|||
|
||||
it 'returns an error when period is invalid' do
|
||||
exp_date = (Date.today + 1.year)
|
||||
xml = domain_renew_xml(period_value: 4, curExpDate: exp_date.to_s)
|
||||
|
||||
xml = EppXml::Domain.renew(
|
||||
name: { value: 'example.ee' },
|
||||
curExpDate: { value: exp_date.to_s },
|
||||
period: { value: '4', attrs: { unit: 'y' } }
|
||||
)
|
||||
|
||||
response = epp_request(xml, :xml)
|
||||
expect(response[:results][0][:result_code]).to eq('2004')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue