Bump epp-xml

This commit is contained in:
Martin Lensment 2014-11-03 11:26:08 +02:00
parent 4c7895a7fb
commit fed8c94884
5 changed files with 5 additions and 60 deletions

View file

@ -85,7 +85,7 @@ group :development, :test do
gem 'epp', '~> 1.4.0'
# EPP XMLs
gem 'epp-xml', '~> 0.2.0'
gem 'epp-xml', '~> 0.3.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.2.0)
epp-xml (0.3.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.2.0)
epp-xml (~> 0.3.0)
fabrication (~> 2.11.3)
faker (~> 1.3.0)
guard (~> 2.6.1)

View file

@ -1032,7 +1032,7 @@ describe 'EPP Domain', epp: true do
it 'deletes domain' do
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(Domain.first).to eq(nil)
@ -1042,7 +1042,7 @@ describe 'EPP Domain', epp: true do
it 'does not delete domain with specific status' do
d = Domain.first
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[:msg]).to eq('Domain status prohibits operation')
end

View file

@ -86,41 +86,5 @@ describe 'EPP Helper', epp: true do
generated = Nokogiri::XML(xml).to_s.squish
expect(generated).to eq(expected)
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

View file

@ -127,25 +127,6 @@ module Epp
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
RSpec.configure do |c|