mirror of
https://github.com/internetee/registry.git
synced 2025-05-18 18:29:40 +02:00
Remove check builder
This commit is contained in:
parent
5cdab8faa7
commit
37c6bf1f8c
2 changed files with 0 additions and 57 deletions
|
@ -2,44 +2,6 @@ require 'rails_helper'
|
|||
|
||||
describe 'EPP Helper', epp: true do
|
||||
context 'in context of Domain' do
|
||||
it 'generates valid check 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>
|
||||
<check>
|
||||
<domain:check
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.ee</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
||||
').to_s.squish
|
||||
|
||||
generated = Nokogiri::XML(domain_check_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>
|
||||
<check>
|
||||
<domain:check
|
||||
xmlns:domain="urn:ietf:params:xml:ns:domain-1.0">
|
||||
<domain:name>example.ee</domain:name>
|
||||
<domain:name>example2.ee</domain:name>
|
||||
<domain:name>example3.ee</domain:name>
|
||||
</domain:check>
|
||||
</check>
|
||||
<clTRID>ABC-12345</clTRID>
|
||||
</command>
|
||||
</epp>
|
||||
').to_s.squish
|
||||
|
||||
generated = Nokogiri::XML(domain_check_xml(names: ['example.ee', 'example2.ee', 'example3.ee'])).to_s.squish
|
||||
expect(generated).to eq(expected)
|
||||
end
|
||||
|
||||
it 'generates valid renew xml' do
|
||||
expected = Nokogiri::XML('<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<epp xmlns="urn:ietf:params:xml:ns:epp-1.0">
|
||||
|
|
|
@ -73,25 +73,6 @@ module Epp
|
|||
end
|
||||
end
|
||||
|
||||
def domain_check_xml(xml_params = {})
|
||||
xml_params[:names] = xml_params[:names] || ['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.check do
|
||||
xml.tag!('domain:check', 'xmlns:domain' => 'urn:ietf:params:xml:ns:domain-1.0') do
|
||||
xml_params[:names].each do |x|
|
||||
xml.tag!('domain:name', (x || 'example.ee'))
|
||||
end if xml_params[:names].any?
|
||||
end
|
||||
end
|
||||
xml.clTRID 'ABC-12345'
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def domain_update_xml(xml_params = {}, dnssec_params = false)
|
||||
defaults = {
|
||||
name: { value: 'example.ee' }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue