Refactor delete.xml to builder

This commit is contained in:
Martin Lensment 2014-09-01 12:10:31 +03:00
parent 08a4650f4a
commit afc69629ef
5 changed files with 72 additions and 14 deletions

View file

@ -216,6 +216,25 @@ 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|