mirror of
https://github.com/internetee/registry.git
synced 2025-05-19 02:39:37 +02:00
Bump epp-xml
This commit is contained in:
parent
4c7895a7fb
commit
fed8c94884
5 changed files with 5 additions and 60 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', '~> 0.2.0'
|
gem 'epp-xml', '~> 0.3.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.2.0)
|
epp-xml (0.3.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 (~> 0.2.0)
|
epp-xml (~> 0.3.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)
|
||||||
|
|
|
@ -1032,7 +1032,7 @@ describe 'EPP Domain', epp: true do
|
||||||
|
|
||||||
it 'deletes domain' do
|
it 'deletes domain' do
|
||||||
expect(DomainContact.count).to eq(2)
|
expect(DomainContact.count).to eq(2)
|
||||||
response = epp_request(domain_delete_xml, :xml)
|
response = epp_request(EppXml::Domain.delete(name: { value: 'example.ee' }), :xml)
|
||||||
expect(response[:result_code]).to eq('1000')
|
expect(response[:result_code]).to eq('1000')
|
||||||
|
|
||||||
expect(Domain.first).to eq(nil)
|
expect(Domain.first).to eq(nil)
|
||||||
|
@ -1042,7 +1042,7 @@ describe 'EPP Domain', epp: true do
|
||||||
it 'does not delete domain with specific status' do
|
it 'does not delete domain with specific status' do
|
||||||
d = Domain.first
|
d = Domain.first
|
||||||
d.domain_statuses.create(value: DomainStatus::CLIENT_DELETE_PROHIBITED)
|
d.domain_statuses.create(value: DomainStatus::CLIENT_DELETE_PROHIBITED)
|
||||||
response = epp_request(domain_delete_xml, :xml)
|
response = epp_request(EppXml::Domain.delete(name: { value: 'example.ee' }), :xml)
|
||||||
expect(response[:result_code]).to eq('2304')
|
expect(response[:result_code]).to eq('2304')
|
||||||
expect(response[:msg]).to eq('Domain status prohibits operation')
|
expect(response[:msg]).to eq('Domain status prohibits operation')
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,41 +86,5 @@ describe 'EPP Helper', epp: true do
|
||||||
generated = Nokogiri::XML(xml).to_s.squish
|
generated = Nokogiri::XML(xml).to_s.squish
|
||||||
expect(generated).to eq(expected)
|
expect(generated).to eq(expected)
|
||||||
end
|
end
|
||||||
|
|
||||||
it 'generates valid delete xml' do
|
|
||||||
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
|
||||||
<command>
|
|
||||||
<delete>
|
|
||||||
<domain:delete
|
|
||||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
|
||||||
<domain:name>example.ee</domain:name>
|
|
||||||
</domain:delete>
|
|
||||||
</delete>
|
|
||||||
<clTRID>ABC-12345</clTRID>
|
|
||||||
</command>
|
|
||||||
</epp>
|
|
||||||
').to_s.squish
|
|
||||||
|
|
||||||
generated = Nokogiri::XML(domain_delete_xml).to_s.squish
|
|
||||||
expect(generated).to eq(expected)
|
|
||||||
|
|
||||||
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
|
||||||
<command>
|
|
||||||
<delete>
|
|
||||||
<domain:delete
|
|
||||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
|
||||||
<domain:name>one.ee</domain:name>
|
|
||||||
</domain:delete>
|
|
||||||
</delete>
|
|
||||||
<clTRID>ABC-12345</clTRID>
|
|
||||||
</command>
|
|
||||||
</epp>
|
|
||||||
').to_s.squish
|
|
||||||
|
|
||||||
generated = Nokogiri::XML(domain_delete_xml(name: 'one.ee')).to_s.squish
|
|
||||||
expect(generated).to eq(expected)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -127,25 +127,6 @@ module Epp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def domain_delete_xml(xml_params = {})
|
|
||||||
xml_params[:name] = xml_params[:name] || 'example.ee'
|
|
||||||
xml = Builder::XmlMarkup.new
|
|
||||||
|
|
||||||
xml.instruct!(:xml, standalone: 'no')
|
|
||||||
xml.epp('xmlns' => 'urn:ietf:params:xml:ns:epp-1.0') do
|
|
||||||
xml.command do
|
|
||||||
xml.delete do
|
|
||||||
xml.tag!('domain:delete', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do
|
|
||||||
if xml_params[:name] != false
|
|
||||||
xml.tag!('domain:name', xml_params[:name])
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
xml.clTRID 'ABC-12345'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
RSpec.configure do |c|
|
RSpec.configure do |c|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue