diff --git a/Gemfile b/Gemfile index 9a83dfb83..72210a40a 100644 --- a/Gemfile +++ b/Gemfile @@ -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' diff --git a/Gemfile.lock b/Gemfile.lock index c23970e87..ac74083be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) diff --git a/spec/epp/domain_spec.rb b/spec/epp/domain_spec.rb index 984bcc003..ac1022fcc 100644 --- a/spec/epp/domain_spec.rb +++ b/spec/epp/domain_spec.rb @@ -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 diff --git a/spec/epp/epp_helper_spec.rb b/spec/epp/epp_helper_spec.rb index 00d49c933..1283c164e 100644 --- a/spec/epp/epp_helper_spec.rb +++ b/spec/epp/epp_helper_spec.rb @@ -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(' - - - - - example.ee - - - ABC-12345 - - - ').to_s.squish - - generated = Nokogiri::XML(domain_delete_xml).to_s.squish - expect(generated).to eq(expected) - - expected = Nokogiri::XML(' - - - - - one.ee - - - ABC-12345 - - - ').to_s.squish - - generated = Nokogiri::XML(domain_delete_xml(name: 'one.ee')).to_s.squish - expect(generated).to eq(expected) - end end end diff --git a/spec/support/epp.rb b/spec/support/epp.rb index ab57f2b26..1f456775d 100644 --- a/spec/support/epp.rb +++ b/spec/support/epp.rb @@ -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|