diff --git a/app/controllers/registrar/xml_consoles_controller.rb b/app/controllers/registrar/xml_consoles_controller.rb index fef6b33ad..fd6804159 100644 --- a/app/controllers/registrar/xml_consoles_controller.rb +++ b/app/controllers/registrar/xml_consoles_controller.rb @@ -29,16 +29,34 @@ class Registrar render plain: xml end - protected + private def prepare_payload(xml, cl_trid) PREFS.map do |pref| - xml.gsub!('"' + pref.to_s + '"', - "\"#{Xsd::Schema.filename(for_prefix: pref.to_s)}\"") + xml = load_schema_by_prefix(pref, xml) end xml.gsub!('ABC-12345', "#{cl_trid}") xml end + + def load_schema_by_prefix(pref, xml) + case pref + when 'epp-ee' + insert_prefix_and_version(xml, pref, '1.0') + when 'eis' + insert_prefix_and_version(xml, pref, '1.0') + when 'contact-ee' + insert_prefix_and_version(xml, pref, '1.1') + else + insert_prefix_and_version(xml, pref, '1.1') + end + end + + def insert_prefix_and_version(xml, pref, version) + xml.gsub!('"' + pref.to_s + '"', + "\"#{Xsd::Schema.filename(for_prefix: pref.to_s, for_version: version)}\"") + xml + end end end diff --git a/app/views/epp/contacts/check.xml.builder b/app/views/epp/contacts/check.xml.builder index 8e265b02f..6b4ea4cc7 100644 --- a/app/views/epp/contacts/check.xml.builder +++ b/app/views/epp/contacts/check.xml.builder @@ -5,7 +5,8 @@ xml.epp_head do end xml.resData do - xml.tag!('contact:chkData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee')) do + xml.tag!('contact:chkData', 'xmlns:contact' => + Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')) do @results.each do |result| xml.tag!('contact:cd') do xml.tag! "contact:id", result[:code], avail: result[:avail] diff --git a/app/views/epp/contacts/info.xml.builder b/app/views/epp/contacts/info.xml.builder index 525396772..053565c09 100644 --- a/app/views/epp/contacts/info.xml.builder +++ b/app/views/epp/contacts/info.xml.builder @@ -5,7 +5,8 @@ xml.epp_head do end xml.resData do - xml.tag!('contact:infData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')) do + xml.tag!('contact:infData', 'xmlns:contact' => + Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')) do xml.tag!('contact:id', @contact.code) xml.tag!('contact:roid', @contact.roid) @@ -78,7 +79,8 @@ xml.epp_head do end if can? :view_full_info, @contact, @password xml.tag!('extension') do - xml.tag!('eis:extdata', 'xmlns:eis' => Xsd::Schema.filename(for_prefix: 'eis', for_version: '1.0')) do + xml.tag!('eis:extdata', 'xmlns:eis' => + Xsd::Schema.filename(for_prefix: 'eis', for_version: '1.0')) do xml.tag!('eis:ident', @contact.ident, type: @contact.ident_type, cc: @contact.ident_country_code) end diff --git a/app/views/epp/contacts/save.xml.builder b/app/views/epp/contacts/save.xml.builder index 2fd3737e3..c3f3a6059 100644 --- a/app/views/epp/contacts/save.xml.builder +++ b/app/views/epp/contacts/save.xml.builder @@ -5,9 +5,10 @@ xml.epp_head do end xml.resData do - xml.tag!('contact:creData', 'xmlns:contact' => Xsd::Schema.filename(for_prefix: 'contact-ee')) do - xml.tag!('contact:id', @contact.code) - xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) + xml.tag!('contact:creData', 'xmlns:contact' => + Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')) do + xml.tag!('contact:id', @contact.code) + xml.tag!('contact:crDate', @contact.created_at.try(:iso8601)) end end diff --git a/app/views/epp/domains/partials/_transfer.xml.builder b/app/views/epp/domains/partials/_transfer.xml.builder index dbe8ad384..31ed3dfe6 100644 --- a/app/views/epp/domains/partials/_transfer.xml.builder +++ b/app/views/epp/domains/partials/_transfer.xml.builder @@ -1,4 +1,5 @@ -builder.tag!('domain:trnData', 'xmlns:domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version)) do +builder.tag!('domain:trnData', 'xmlns:domain' => + Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version)) do builder.tag!('domain:name', dt.domain_name) builder.tag!('domain:trStatus', dt.status) builder.tag!('domain:reID', dt.new_registrar.code) diff --git a/app/views/epp/sessions/greeting.xml.builder b/app/views/epp/sessions/greeting.xml.builder index 054307652..fbaae0dfc 100644 --- a/app/views/epp/sessions/greeting.xml.builder +++ b/app/views/epp/sessions/greeting.xml.builder @@ -5,12 +5,12 @@ xml.epp_head do xml.svcMenu do xml.version '1.0' xml.lang 'en' - xml.objURI Xsd::Schema.filename(for_prefix: 'domain-ee') - xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee') + xml.objURI Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: @schema_version) + xml.objURI Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: @schema_version) xml.objURI 'urn:ietf:params:xml:ns:host-1.0' xml.svcExtension do xml.extURI 'urn:ietf:params:xml:ns:secDNS-1.1' - xml.extURI Xsd::Schema.filename(for_prefix: 'eis') + xml.extURI Xsd::Schema.filename(for_prefix: 'eis', for_version: @schema_version) end end diff --git a/lib/epp_constraint.rb b/lib/epp_constraint.rb index 845671173..d7e37bfe3 100644 --- a/lib/epp_constraint.rb +++ b/lib/epp_constraint.rb @@ -2,9 +2,10 @@ class EppConstraint OBJECT_TYPES = { domain: [ { domain: Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1') }, + { domain: Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.2') }, { domain: Xsd::Schema.filename(for_prefix: 'domain-eis', for_version: '1.0') }, ], - contact: { contact: Xsd::Schema.filename(for_prefix: 'contact-ee') }, + contact: { contact: Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1') }, }.freeze def initialize(type) diff --git a/lib/gem_monkey_patches/builder.rb b/lib/gem_monkey_patches/builder.rb index 550239999..9bd4fbcea 100644 --- a/lib/gem_monkey_patches/builder.rb +++ b/lib/gem_monkey_patches/builder.rb @@ -3,7 +3,7 @@ module Builder def epp_head instruct! epp( - 'xmlns' => ::Xsd::Schema.filename(for_prefix: 'epp-ee'), + 'xmlns' => ::Xsd::Schema.filename(for_prefix: 'epp-ee', for_version: '1.0'), 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance', 'xsi:schemaLocation' => 'lib/schemas/epp-ee-1.0.xsd' ) do diff --git a/lib/schemas/domain-ee-1.2.xsd b/lib/schemas/domain-ee-1.2.xsd new file mode 100644 index 000000000..073986ac7 --- /dev/null +++ b/lib/schemas/domain-ee-1.2.xsd @@ -0,0 +1,472 @@ + + + + + + + + + + + + + + Extensible Provisioning Protocol v1.0 + domain provisioning schema. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/lib/xsd/schema.rb b/lib/xsd/schema.rb index 0f3897114..b48237053 100644 --- a/lib/xsd/schema.rb +++ b/lib/xsd/schema.rb @@ -27,7 +27,7 @@ module Xsd def initialize(params) schema_path = params.fetch(:schema_path, SCHEMA_PATH) @for_prefix = params.fetch(:for_prefix) - @for_version = params.fetch(:for_version, '1.1') + @for_version = params[:for_version] || '1.1' @xsd_schemas = Dir.entries(schema_path).select { |f| File.file? File.join(schema_path, f) } end @@ -48,21 +48,20 @@ module Xsd schemas.each do |schema| actual_schema = assigment_actual_version(schema) + break unless actual_schema.empty? end actual_schema end def assigment_actual_version(schema) - result = return_some(schema) + result = return_parsed_schema(schema) actual_schema = schema if result[:version] == @for_version - actual_schema = 'epp-ee-1.0.xsd' if result[:prefix] == 'epp-ee' - actual_schema = 'eis-1.0.xsd' if result[:prefix] == 'eis' actual_schema.to_s end - def return_some(data) + def return_parsed_schema(data) res = data.to_s.match(REGEX_PREFIX_WITH_DASH) res = data.to_s.match(REGEX_PREFIX_WITHOUT_DASH) if res.nil? res diff --git a/test/integration/admin_area/domain_update_confirms_test.rb b/test/integration/admin_area/domain_update_confirms_test.rb index 5d26a004a..3cd64a872 100644 --- a/test/integration/admin_area/domain_update_confirms_test.rb +++ b/test/integration/admin_area/domain_update_confirms_test.rb @@ -15,10 +15,10 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa puts new_registrant.name request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -26,7 +26,7 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa - + #{'test' * 2000} @@ -50,10 +50,10 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa @domain.registrant request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -61,7 +61,7 @@ class AdminAreaBlockedDomainsIntegrationTest < JavaScriptApplicationSystemTestCa - + #{'test' * 2000} diff --git a/test/integration/admin_area/epp_logs_test.rb b/test/integration/admin_area/epp_logs_test.rb index 221e05f8c..82c450fad 100644 --- a/test/integration/admin_area/epp_logs_test.rb +++ b/test/integration/admin_area/epp_logs_test.rb @@ -41,7 +41,7 @@ class AdminEppLogsIntegrationTest < ApplicationSystemTestCase def send_epp_request_hello request_xml = <<-XML - + XML diff --git a/test/integration/epp/base_test.rb b/test/integration/epp/base_test.rb index 56ea3f2e8..4aa89e1ed 100644 --- a/test/integration/epp/base_test.rb +++ b/test/integration/epp/base_test.rb @@ -37,7 +37,7 @@ class EppBaseTest < EppTestCase def test_wrong_path_xml wrong_path_xml = <<-XML - + @@ -63,7 +63,7 @@ class EppBaseTest < EppTestCase def test_error_with_unknown_command invalid_xml = <<-XML - + XML @@ -76,7 +76,7 @@ class EppBaseTest < EppTestCase def test_validates_request_xml invalid_xml = <<-XML - + XML post valid_command_path, params: { frame: invalid_xml }, @@ -88,10 +88,10 @@ class EppBaseTest < EppTestCase def test_anonymous_user xml_of_epp_command_that_requires_authentication = <<-XML - + - + #{domains(:shop).name} @@ -112,10 +112,10 @@ class EppBaseTest < EppTestCase xml_of_epp_command_that_requires_authorization = <<-XML - + - + #{domains(:shop).name} @@ -138,10 +138,10 @@ class EppBaseTest < EppTestCase authentication_enabled_epp_request_xml = <<-XML - + - + #{domains(:shop).name} @@ -165,10 +165,10 @@ class EppBaseTest < EppTestCase authentication_enabled_epp_request_xml = <<-XML - + - + #{domains(:shop).name} @@ -194,7 +194,7 @@ class EppBaseTest < EppTestCase def valid_request_xml <<-XML - + XML diff --git a/test/integration/epp/contact/base_test.rb b/test/integration/epp/contact/base_test.rb index 2767fe277..f26851ee1 100644 --- a/test/integration/epp/contact/base_test.rb +++ b/test/integration/epp/contact/base_test.rb @@ -4,10 +4,10 @@ class EppContactBaseTest < EppTestCase def test_non_existent_contact request_xml = <<-XML - + - + non-existent diff --git a/test/integration/epp/contact/check/base_test.rb b/test/integration/epp/contact/check/base_test.rb index 549cdf3ae..f1b9f4d16 100644 --- a/test/integration/epp/contact/check/base_test.rb +++ b/test/integration/epp/contact/check/base_test.rb @@ -10,10 +10,10 @@ class EppContactCheckBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 @@ -33,10 +33,10 @@ class EppContactCheckBaseTest < EppTestCase def test_contact_is_available request_xml = <<-XML - + - + non-existing-id @@ -59,10 +59,10 @@ class EppContactCheckBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 @@ -82,10 +82,10 @@ class EppContactCheckBaseTest < EppTestCase def test_multiple_contacts request_xml = <<-XML - + - + one.test two.test three.test @@ -109,10 +109,10 @@ class EppContactCheckBaseTest < EppTestCase request_xml = <<-XML - + - + BESTNAMES:JOHN-001 @@ -136,10 +136,10 @@ class EppContactCheckBaseTest < EppTestCase request_xml = <<-XML - + - + JOHN-001 @@ -160,6 +160,6 @@ class EppContactCheckBaseTest < EppTestCase private def xml_schema - Xsd::Schema.filename(for_prefix: 'contact-ee') + Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1') end end diff --git a/test/integration/epp/contact/create/base_test.rb b/test/integration/epp/contact/create/base_test.rb index cc91a74a0..b2b65a7ef 100644 --- a/test/integration/epp/contact/create/base_test.rb +++ b/test/integration/epp/contact/create/base_test.rb @@ -8,10 +8,10 @@ class EppContactCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} @@ -20,7 +20,7 @@ class EppContactCreateBaseTest < EppTestCase - + any @@ -88,10 +88,10 @@ class EppContactCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} @@ -100,7 +100,7 @@ class EppContactCreateBaseTest < EppTestCase - + any @@ -125,10 +125,10 @@ class EppContactCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{code} #{name} @@ -138,7 +138,7 @@ class EppContactCreateBaseTest < EppTestCase - + any @@ -158,10 +158,10 @@ class EppContactCreateBaseTest < EppTestCase def test_fails_when_required_attributes_are_missing request_xml = <<-XML - + - + \s @@ -170,7 +170,7 @@ class EppContactCreateBaseTest < EppTestCase - + test @@ -194,10 +194,10 @@ class EppContactCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} @@ -213,7 +213,7 @@ class EppContactCreateBaseTest < EppTestCase - + 123 @@ -255,10 +255,10 @@ class EppContactCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} @@ -274,7 +274,7 @@ class EppContactCreateBaseTest < EppTestCase - + 123 diff --git a/test/integration/epp/contact/delete/base_test.rb b/test/integration/epp/contact/delete/base_test.rb index a90974189..d7af361d5 100644 --- a/test/integration/epp/contact/delete/base_test.rb +++ b/test/integration/epp/contact/delete/base_test.rb @@ -9,10 +9,10 @@ class EppContactDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + #{contact.code} @@ -39,10 +39,10 @@ class EppContactDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + #{contact.code.upcase} @@ -68,10 +68,10 @@ class EppContactDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + #{contact.code.upcase} @@ -97,10 +97,10 @@ class EppContactDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + #{contact.code} diff --git a/test/integration/epp/contact/info/base_test.rb b/test/integration/epp/contact/info/base_test.rb index b43273a88..dc8fcd5f7 100644 --- a/test/integration/epp/contact/info/base_test.rb +++ b/test/integration/epp/contact/info/base_test.rb @@ -18,10 +18,10 @@ class EppContactInfoBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 @@ -51,10 +51,10 @@ class EppContactInfoBaseTest < EppTestCase request_xml = <<-XML - + - + TEST:JOHN-001 @@ -78,10 +78,10 @@ class EppContactInfoBaseTest < EppTestCase request_xml = <<-XML - + - + JOHN-001 @@ -108,10 +108,10 @@ class EppContactInfoBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -132,6 +132,6 @@ class EppContactInfoBaseTest < EppTestCase private def xml_schema - Xsd::Schema.filename(for_prefix: 'contact-ee') + Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1') end end diff --git a/test/integration/epp/contact/transfer/base_test.rb b/test/integration/epp/contact/transfer/base_test.rb index cf28c32c7..a617d7c1d 100644 --- a/test/integration/epp/contact/transfer/base_test.rb +++ b/test/integration/epp/contact/transfer/base_test.rb @@ -5,10 +5,10 @@ class EppContactTransferBaseTest < EppTestCase def test_not_implemented request_xml = <<-XML - + - + any diff --git a/test/integration/epp/contact/update/base_test.rb b/test/integration/epp/contact/update/base_test.rb index 081d37c05..364741f0c 100644 --- a/test/integration/epp/contact/update/base_test.rb +++ b/test/integration/epp/contact/update/base_test.rb @@ -19,10 +19,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 @@ -58,10 +58,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 john-new@inbox.test @@ -89,10 +89,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 john@inbox.test @@ -122,10 +122,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 john-new@inbox.test @@ -148,10 +148,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + non-existing @@ -180,10 +180,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -192,7 +192,7 @@ class EppContactUpdateBaseTest < EppTestCase - + #{new_ident_code} @@ -217,10 +217,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -228,7 +228,7 @@ class EppContactUpdateBaseTest < EppTestCase - + #{@contact.ident} @@ -254,10 +254,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -302,10 +302,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -351,10 +351,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@contact.code} @@ -404,10 +404,10 @@ class EppContactUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + john-001 @@ -419,7 +419,7 @@ class EppContactUpdateBaseTest < EppTestCase - + #{'test' * 2000} diff --git a/test/integration/epp/domain/base_test.rb b/test/integration/epp/domain/base_test.rb index 557d25f59..9b117f3d4 100644 --- a/test/integration/epp/domain/base_test.rb +++ b/test/integration/epp/domain/base_test.rb @@ -4,10 +4,10 @@ class EppDomainBaseTest < EppTestCase def test_non_existent_domain request_xml = <<-XML - + - + non-existent.test @@ -25,7 +25,7 @@ class EppDomainBaseTest < EppTestCase def test_invalid_path request_xml = <<-XML - + diff --git a/test/integration/epp/domain/check/auction_test.rb b/test/integration/epp/domain/check/auction_test.rb index d8a7b5919..ad134794a 100644 --- a/test/integration/epp/domain/check/auction_test.rb +++ b/test/integration/epp/domain/check/auction_test.rb @@ -17,10 +17,10 @@ class EppDomainCheckAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test @@ -34,8 +34,8 @@ class EppDomainCheckAuctionTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_epp_response :completed_successfully - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_idn_ascii_domain_is_unavailable_when_at_auction @@ -43,10 +43,10 @@ class EppDomainCheckAuctionTest < EppTestCase request_xml = <<-XML - + - + xn--pramiid-n2a.test @@ -60,8 +60,8 @@ class EppDomainCheckAuctionTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_epp_response :completed_successfully - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_idn_unicode_domain_is_unavailable_when_at_auction @@ -69,10 +69,10 @@ class EppDomainCheckAuctionTest < EppTestCase request_xml = <<-XML - + - + püramiid.test @@ -86,8 +86,8 @@ class EppDomainCheckAuctionTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_epp_response :completed_successfully - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Domain is at auction', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_unavailable_when_awaiting_payment @@ -95,10 +95,10 @@ class EppDomainCheckAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test @@ -112,8 +112,8 @@ class EppDomainCheckAuctionTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_epp_response :completed_successfully - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Awaiting payment', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_available_when_payment_received @@ -121,10 +121,10 @@ class EppDomainCheckAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test @@ -138,7 +138,7 @@ class EppDomainCheckAuctionTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_epp_response :completed_successfully - assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}") + assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}") end end diff --git a/test/integration/epp/domain/check/base_test.rb b/test/integration/epp/domain/check/base_test.rb index f2f85bed3..3a5b9bd76 100644 --- a/test/integration/epp/domain/check/base_test.rb +++ b/test/integration/epp/domain/check/base_test.rb @@ -4,10 +4,10 @@ class EppDomainCheckBaseTest < EppTestCase def test_returns_valid_response request_xml = <<-XML - + - + some.test @@ -21,16 +21,16 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_epp_response :completed_successfully assert_correct_against_schema response_xml - assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal 'some.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_available_when_not_registered_or_blocked request_xml = <<-XML - + - + available.test @@ -43,8 +43,8 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}") + assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}") end def test_domain_is_available_when_reserved @@ -52,10 +52,10 @@ class EppDomainCheckBaseTest < EppTestCase request_xml = <<-XML - + - + reserved.test @@ -68,17 +68,17 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}") + assert_equal '1', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_nil response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}") end def test_domain_is_unavailable_when_format_is_invalid request_xml = <<-XML - + - + invalid @@ -91,8 +91,8 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'invalid format', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_unavailable_when_registered @@ -100,10 +100,10 @@ class EppDomainCheckBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -116,8 +116,8 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'in use', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_unavailable_when_blocked @@ -125,10 +125,10 @@ class EppDomainCheckBaseTest < EppTestCase request_xml = <<-XML - + - + blocked.test @@ -141,8 +141,8 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Blocked', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_domain_is_unavailable_when_zone_with_the_same_origin_exists @@ -150,10 +150,10 @@ class EppDomainCheckBaseTest < EppTestCase request_xml = <<-XML - + - + test @@ -166,17 +166,17 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}")['avail'] - assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal '0', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}")['avail'] + assert_equal 'Zone with the same origin exists', response_xml.at_xpath('//domain:reason', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_multiple_domains request_xml = <<-XML - + - + one.test two.test three.test @@ -191,6 +191,6 @@ class EppDomainCheckBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").size + assert_equal 3, response_xml.xpath('//domain:cd', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").size end end diff --git a/test/integration/epp/domain/create/auction_idn_test.rb b/test/integration/epp/domain/create/auction_idn_test.rb index 8424c82cb..604b74c7d 100644 --- a/test/integration/epp/domain/create/auction_idn_test.rb +++ b/test/integration/epp/domain/create/auction_idn_test.rb @@ -21,16 +21,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + xn--pramiid-n2a.test #{contacts(:john).code} - + #{'test' * 2000} @@ -59,16 +59,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + püramiid.test #{contacts(:john).code} - + #{'test' * 2000} @@ -96,16 +96,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + xn--pramiid-n2a.test #{contacts(:john).code} - + #{'test' * 2000} @@ -133,16 +133,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + püramiid.test #{contacts(:john).code} - + #{'test' * 2000} @@ -171,16 +171,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + püramiid.test #{contacts(:john).code} - + #{'test' * 2000} auction001 @@ -211,16 +211,16 @@ class EppDomainCreateAuctionIdnTest < EppTestCase request_xml = <<-XML - + - + xn--pramiid-n2a.test #{contacts(:john).code} - + #{'test' * 2000} auction001 diff --git a/test/integration/epp/domain/create/auction_test.rb b/test/integration/epp/domain/create/auction_test.rb index 08ac79ad0..cd20f2dac 100644 --- a/test/integration/epp/domain/create/auction_test.rb +++ b/test/integration/epp/domain/create/auction_test.rb @@ -13,16 +13,16 @@ class EppDomainCreateAuctionTest < EppTestCase def test_registers_domain_without_registration_code_when_not_at_auction request_xml = <<-XML - + - + not-at-auction.test #{contacts(:john).code} - + #{'test' * 2000} @@ -50,16 +50,16 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test #{contacts(:john).code} - + #{'test' * 2000} auction002 @@ -85,16 +85,16 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test #{contacts(:john).code} - + #{'test' * 2000} auction001 @@ -123,16 +123,16 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test #{contacts(:john).code} - + #{'test' * 2000} @@ -155,16 +155,16 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test #{contacts(:john).code} - + #{'test' * 2000} wrong @@ -189,16 +189,16 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test #{contacts(:john).code} - + #{'test' * 2000} test @@ -223,15 +223,15 @@ class EppDomainCreateAuctionTest < EppTestCase request_xml = <<-XML - + - + auction.test - + test diff --git a/test/integration/epp/domain/create/base_test.rb b/test/integration/epp/domain/create/base_test.rb index 0bc8206b4..de36e7a02 100644 --- a/test/integration/epp/domain/create/base_test.rb +++ b/test/integration/epp/domain/create/base_test.rb @@ -14,10 +14,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} @@ -31,7 +31,7 @@ class EppDomainCreateBaseTest < EppTestCase #{pub_key} - + #{'test' * 2000} @@ -56,16 +56,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} - + #{'test' * 2} @@ -91,16 +91,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} - + #{bignum_legaldoc} @@ -129,16 +129,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} - + #{bignum_legaldoc} @@ -167,10 +167,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} @@ -198,10 +198,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contacts(:jane).code} @@ -209,7 +209,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -236,10 +236,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contact.code} @@ -249,7 +249,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -276,10 +276,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contact.code} @@ -288,7 +288,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -315,10 +315,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contact.code} @@ -327,7 +327,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -355,10 +355,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contact.code} @@ -367,7 +367,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -395,10 +395,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} #{contact_two.code} @@ -407,7 +407,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -434,16 +434,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} - + #{'test' * 2000} @@ -484,10 +484,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} @@ -522,10 +522,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{registrant.code} @@ -559,16 +559,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{reserved_domain.name} #{contacts(:john).code} - + #{'test' * 2000} #{registration_code} @@ -597,10 +597,10 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{name} #{contacts(:john).code} @@ -609,7 +609,7 @@ class EppDomainCreateBaseTest < EppTestCase - + #{'test' * 2000} @@ -632,16 +632,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{blocked_domain} #{contacts(:john).code} - + #{'test' * 2000} @@ -664,16 +664,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{SimpleIDN.to_ascii('blockedäöüõ.test')} #{contacts(:john).code} - + #{'test' * 2000} @@ -693,16 +693,16 @@ class EppDomainCreateBaseTest < EppTestCase def test_reserved_domain_cannot_be_registered_with_wrong_registration_code request_xml = <<-XML - + - + #{reserved_domains(:one).name} #{contacts(:john).code} - + #{'test' * 2000} wrong @@ -727,16 +727,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + #{reserved_domain.name} #{contacts(:john).code} - + #{'test' * 2000} @@ -759,16 +759,16 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + new.test #{contacts(:john).code} - + #{'test' * 2000} @@ -789,17 +789,17 @@ class EppDomainCreateBaseTest < EppTestCase request_xml = <<-XML - + - + new.test 2 john-001 - + #{'test' * 2000} diff --git a/test/integration/epp/domain/delete/base_test.rb b/test/integration/epp/domain/delete/base_test.rb index b13c20964..04c6fe714 100644 --- a/test/integration/epp/domain/delete/base_test.rb +++ b/test/integration/epp/domain/delete/base_test.rb @@ -18,15 +18,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + invalid.test - + #{'test' * 2000} @@ -47,15 +47,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + #{'test' * 2000} @@ -77,15 +77,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + #{'test' * 2000} @@ -113,15 +113,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + #{'test' * 2000} @@ -150,15 +150,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + #{'test' * 2000} @@ -186,15 +186,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + #{'test' * 2000} @@ -221,10 +221,10 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -245,15 +245,15 @@ class EppDomainDeleteBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test - + dGVzdCBmYWlsCg== diff --git a/test/integration/epp/domain/info/base_test.rb b/test/integration/epp/domain/info/base_test.rb index ffacc20c8..3e4178054 100644 --- a/test/integration/epp/domain/info/base_test.rb +++ b/test/integration/epp/domain/info/base_test.rb @@ -10,10 +10,10 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -30,28 +30,28 @@ class EppDomainInfoBaseTest < EppTestCase assert assert_schema_is_bigger(response_xml, 'domain-ee', 1.1) assert_equal 'shop.test', response_xml.at_xpath('//domain:name', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_equal 'ok', response_xml.at_xpath('//domain:status', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s)['s'] + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s)['s'] assert_equal 'john-001', response_xml.at_xpath('//domain:registrant', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_equal '2010-07-05T00:00:00+03:00', response_xml.at_xpath('//domain:crDate', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_equal '2010-07-06T00:00:00+03:00', response_xml.at_xpath('//domain:upDate', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_equal '2010-07-07T00:00:00+03:00', response_xml.at_xpath('//domain:exDate', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text end def test_return_wrong_schema_with_invalid_version request_xml = <<-XML - + @@ -71,7 +71,7 @@ class EppDomainInfoBaseTest < EppTestCase def test_return_valid_response_if_specify_the_version request_xml = <<-XML - + @@ -88,6 +88,27 @@ class EppDomainInfoBaseTest < EppTestCase assert_epp_response :completed_successfully end + def test_return_valid_response_if_specify_the_version_1_2 + request_xml = <<-XML + + + + + + shop.test + + + + + XML + + p request_xml + post epp_info_path, params: { frame: request_xml }, + headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } + + assert_epp_response :completed_successfully + end + def test_returns_valid_response_if_schema_version_is_previous dispute = disputes(:expired) dispute.update!(starts_at: Time.zone.now, expires_at: Time.zone.now + 5.days, closed: nil) @@ -103,7 +124,7 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + @@ -140,10 +161,10 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -168,10 +189,10 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -192,10 +213,10 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -209,7 +230,7 @@ class EppDomainInfoBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_correct_against_schema response_xml end @@ -220,10 +241,10 @@ class EppDomainInfoBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test 65078d5 @@ -240,17 +261,17 @@ class EppDomainInfoBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_equal '65078d5', response_xml.at_xpath('//domain:authInfo/domain:pw', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s).text + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s).text assert_correct_against_schema response_xml end def test_conceals_transfer_code_when_domain_is_not_owned_by_current_user request_xml = <<-XML - + - + shop.test @@ -267,6 +288,6 @@ class EppDomainInfoBaseTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_nil response_xml.at_xpath('//domain:authInfo/domain:pw', - 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee').to_s) + 'domain' => Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1').to_s) end end diff --git a/test/integration/epp/domain/renew/base_test.rb b/test/integration/epp/domain/renew/base_test.rb index d886bd563..6cbe619d4 100644 --- a/test/integration/epp/domain/renew/base_test.rb +++ b/test/integration/epp/domain/renew/base_test.rb @@ -11,10 +11,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.expire_time.to_date} 1 @@ -45,10 +45,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.expire_time.to_date} 1 @@ -75,10 +75,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.valid_to.to_date} 1 @@ -106,10 +106,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.valid_to.to_date} 1 @@ -137,10 +137,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.expire_time.to_date} 1 @@ -167,10 +167,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.expire_time.to_date} 2 @@ -198,10 +198,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{provided_expiration_date} @@ -232,10 +232,10 @@ class EppDomainRenewBaseTest < EppTestCase request_xml = <<-XML - + - + #{domain.name} #{domain.expire_time.to_date} 1 diff --git a/test/integration/epp/domain/transfer/query_test.rb b/test/integration/epp/domain/transfer/query_test.rb index d4a1d1951..7635d8a8b 100644 --- a/test/integration/epp/domain/transfer/query_test.rb +++ b/test/integration/epp/domain/transfer/query_test.rb @@ -9,19 +9,19 @@ class EppDomainTransferQueryTest < EppTestCase assert_correct_against_schema xml_doc assert_epp_response :completed_successfully - assert_equal 'shop.test', xml_doc.xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text - assert_equal 'serverApproved', xml_doc.xpath('//domain:trStatus', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text - assert_equal 'goodnames', xml_doc.xpath('//domain:reID', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text - assert_equal 'bestnames', xml_doc.xpath('//domain:acID', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal 'shop.test', xml_doc.xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text + assert_equal 'serverApproved', xml_doc.xpath('//domain:trStatus', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text + assert_equal 'goodnames', xml_doc.xpath('//domain:reID', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text + assert_equal 'bestnames', xml_doc.xpath('//domain:acID', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_wrong_transfer_code request_xml = <<-XML - + - + shop.test wrong @@ -54,10 +54,10 @@ class EppDomainTransferQueryTest < EppTestCase def request_xml <<-XML - + - + shop.test 65078d5 diff --git a/test/integration/epp/domain/transfer/request_test.rb b/test/integration/epp/domain/transfer/request_test.rb index 44be712f0..1e706ce6b 100644 --- a/test/integration/epp/domain/transfer/request_test.rb +++ b/test/integration/epp/domain/transfer/request_test.rb @@ -133,7 +133,7 @@ class EppDomainTransferRequestTest < EppTestCase response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml assert_equal 'serverApproved', Nokogiri::XML(response.body).xpath('//domain:trStatus', 'domain' => - "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_assigns_new_registrar @@ -233,10 +233,10 @@ class EppDomainTransferRequestTest < EppTestCase def test_wrong_transfer_code request_xml = <<-XML - + - + shop.test wrong @@ -262,10 +262,10 @@ class EppDomainTransferRequestTest < EppTestCase def request_xml <<-XML - + - + shop.test 65078d5 @@ -273,7 +273,7 @@ class EppDomainTransferRequestTest < EppTestCase - + #{'test' * 2000} diff --git a/test/integration/epp/domain/update/base_test.rb b/test/integration/epp/domain/update/base_test.rb index 54f817c94..644619644 100644 --- a/test/integration/epp/domain/update/base_test.rb +++ b/test/integration/epp/domain/update/base_test.rb @@ -20,10 +20,10 @@ class EppDomainUpdateBaseTest < EppTestCase def test_update_dnskey_with_invalid_alg request_xml = <<~XML - + - + shop.test @@ -51,10 +51,10 @@ class EppDomainUpdateBaseTest < EppTestCase def test_update_domain request_xml = <<-XML - + - + shop.test @@ -81,10 +81,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -102,10 +102,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test @@ -125,10 +125,10 @@ class EppDomainUpdateBaseTest < EppTestCase DomainStatus::PENDING_UPDATE]) request_xml = <<-XML - + - + #{@domain.name} @@ -142,7 +142,7 @@ class EppDomainUpdateBaseTest < EppTestCase assert_epp_response :object_status_prohibits_operation response_xml = Nokogiri::XML(response.body) assert_correct_against_schema response_xml - assert_equal DomainStatus::PENDING_UPDATE, response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee')}").text + assert_equal DomainStatus::PENDING_UPDATE, response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')}").text end def test_requires_verification_from_current_registrant_when_provided_registrant_is_a_new_one @@ -152,10 +152,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -163,7 +163,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -198,10 +198,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -209,7 +209,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -235,10 +235,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -246,7 +246,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -280,10 +280,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -318,10 +318,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -354,10 +354,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -365,7 +365,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -390,10 +390,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{@domain.registrant.code} @@ -401,7 +401,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -431,10 +431,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -442,7 +442,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} #{dispute.password} @@ -476,10 +476,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -487,7 +487,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} '123456' @@ -517,10 +517,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -528,7 +528,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -556,10 +556,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -567,7 +567,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -597,10 +597,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} #{new_registrant.code} @@ -608,7 +608,7 @@ class EppDomainUpdateBaseTest < EppTestCase - + #{'test' * 2000} @@ -636,10 +636,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + #{@domain.name} @@ -671,10 +671,10 @@ class EppDomainUpdateBaseTest < EppTestCase def test_update_domain_allows_add_of_client_hold request_xml = <<-XML - + - + shop.test Test @@ -702,10 +702,10 @@ class EppDomainUpdateBaseTest < EppTestCase request_xml = <<-XML - + - + shop.test Test @@ -730,10 +730,10 @@ class EppDomainUpdateBaseTest < EppTestCase assert_not_includes(@domain.statuses, DomainStatus::CLIENT_HOLD) request_xml = <<-XML - + - + #{@domain.name} diff --git a/test/integration/epp/domain/update/rem_dns_test.rb b/test/integration/epp/domain/update/rem_dns_test.rb index 537b9a708..a34b52063 100644 --- a/test/integration/epp/domain/update/rem_dns_test.rb +++ b/test/integration/epp/domain/update/rem_dns_test.rb @@ -22,10 +22,10 @@ class EppDomainUpdateRemDnsTest < EppTestCase def test_remove_dnskey_if_explicitly_set request_xml = <<-XML - + - + shop.test @@ -62,10 +62,10 @@ class EppDomainUpdateRemDnsTest < EppTestCase def test_remove_dnskey_if_remove_all request_xml = <<-XML - + - + shop.test diff --git a/test/integration/epp/hello_test.rb b/test/integration/epp/hello_test.rb index 721ae5932..6617e7610 100644 --- a/test/integration/epp/hello_test.rb +++ b/test/integration/epp/hello_test.rb @@ -4,7 +4,7 @@ class EppHelloTest < EppTestCase def test_anonymous_user_is_able_to_access request_xml = <<-XML - + XML diff --git a/test/integration/epp/login_test.rb b/test/integration/epp/login_test.rb index c053fc65a..4ac3ad6e6 100644 --- a/test/integration/epp/login_test.rb +++ b/test/integration/epp/login_test.rb @@ -15,7 +15,7 @@ class EppLoginTest < EppTestCase request_xml = <<-XML - + #{user.username} @@ -25,8 +25,8 @@ class EppLoginTest < EppTestCase en - #{Xsd::Schema.filename(for_prefix: 'domain-ee')} - #{Xsd::Schema.filename(for_prefix: 'contact-ee')} + #{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')} + #{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')} urn:ietf:params:xml:ns:host-1.0 urn:ietf:params:xml:ns:keyrelay-1.0 @@ -50,7 +50,7 @@ class EppLoginTest < EppTestCase request_xml = <<-XML - + #{user.username} @@ -60,8 +60,8 @@ class EppLoginTest < EppTestCase en - #{Xsd::Schema.filename(for_prefix: 'domain-ee')} - #{Xsd::Schema.filename(for_prefix: 'contact-ee')} + #{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')} + #{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')} urn:ietf:params:xml:ns:host-1.0 urn:ietf:params:xml:ns:keyrelay-1.0 @@ -84,7 +84,7 @@ class EppLoginTest < EppTestCase request_xml = <<-XML - + #{user.username} @@ -94,8 +94,8 @@ class EppLoginTest < EppTestCase en - #{Xsd::Schema.filename(for_prefix: 'domain-ee')} - #{Xsd::Schema.filename(for_prefix: 'contact-ee')} + #{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')} + #{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')} urn:ietf:params:xml:ns:host-1.0 urn:ietf:params:xml:ns:keyrelay-1.0 @@ -118,7 +118,7 @@ class EppLoginTest < EppTestCase request_xml = <<-XML - + #{user.username} @@ -129,8 +129,8 @@ class EppLoginTest < EppTestCase en - #{Xsd::Schema.filename(for_prefix: 'domain-ee')} - #{Xsd::Schema.filename(for_prefix: 'contact-ee')} + #{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')} + #{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')} urn:ietf:params:xml:ns:host-1.0 urn:ietf:params:xml:ns:keyrelay-1.0 @@ -154,7 +154,7 @@ class EppLoginTest < EppTestCase request_xml = <<-XML - + #{user.username} @@ -164,8 +164,8 @@ class EppLoginTest < EppTestCase en - #{Xsd::Schema.filename(for_prefix: 'domain-ee')} - #{Xsd::Schema.filename(for_prefix: 'contact-ee')} + #{Xsd::Schema.filename(for_prefix: 'domain-ee', for_version: '1.1')} + #{Xsd::Schema.filename(for_prefix: 'contact-ee', for_version: '1.1')} urn:ietf:params:xml:ns:host-1.0 urn:ietf:params:xml:ns:keyrelay-1.0 diff --git a/test/integration/epp/logout_test.rb b/test/integration/epp/logout_test.rb index 7d53bfd4d..62a32be3e 100644 --- a/test/integration/epp/logout_test.rb +++ b/test/integration/epp/logout_test.rb @@ -30,7 +30,7 @@ class EppLogoutTest < EppTestCase def request_xml <<-XML - + diff --git a/test/integration/epp/poll_test.rb b/test/integration/epp/poll_test.rb index fc41307d2..5cdb7e524 100644 --- a/test/integration/epp/poll_test.rb +++ b/test/integration/epp/poll_test.rb @@ -9,7 +9,7 @@ class EppPollTest < EppTestCase def test_return_latest_notification_when_queue_is_not_empty request_xml = <<-XML - + @@ -32,7 +32,7 @@ class EppPollTest < EppTestCase request_xml = <<-XML - + @@ -56,7 +56,7 @@ class EppPollTest < EppTestCase request_xml = <<-XML - + @@ -81,7 +81,7 @@ class EppPollTest < EppTestCase request_xml = <<-XML - + @@ -98,7 +98,7 @@ class EppPollTest < EppTestCase request_xml = <<-XML - + @@ -121,7 +121,7 @@ class EppPollTest < EppTestCase request_xml = <<-XML - + @@ -138,7 +138,7 @@ class EppPollTest < EppTestCase def test_notification_not_found request_xml = <<-XML - + @@ -153,7 +153,7 @@ class EppPollTest < EppTestCase def test_anonymous_user_cannot_access request_xml = <<-XML - + diff --git a/test/lib/deserializers/xml/contact_test.rb b/test/lib/deserializers/xml/contact_test.rb index 0ad86bbd9..32b6a2549 100644 --- a/test/lib/deserializers/xml/contact_test.rb +++ b/test/lib/deserializers/xml/contact_test.rb @@ -14,10 +14,10 @@ class DeserializersXmlContactTest < ActiveSupport::TestCase def test_handles_update xml_string = <<-XML - + - + john-001 @@ -48,10 +48,10 @@ class DeserializersXmlContactTest < ActiveSupport::TestCase xml_string = <<-XML - + - + #{name} @@ -60,7 +60,7 @@ class DeserializersXmlContactTest < ActiveSupport::TestCase - + any @@ -76,10 +76,10 @@ class DeserializersXmlContactTest < ActiveSupport::TestCase def test_handles_statuses xml_string = <<-XML - + - + john-001 diff --git a/test/lib/deserializers/xml/ident_test.rb b/test/lib/deserializers/xml/ident_test.rb index ff9989e21..046ee5935 100644 --- a/test/lib/deserializers/xml/ident_test.rb +++ b/test/lib/deserializers/xml/ident_test.rb @@ -5,10 +5,10 @@ class DeserializersXmlIdentTest < ActiveSupport::TestCase def test_returns_empty_hash_when_not_present xml_string = <<-XML - + - + john-001 @@ -31,10 +31,10 @@ class DeserializersXmlIdentTest < ActiveSupport::TestCase def test_returns_empty_hash_when_not_valid xml_string = <<-XML - + - + FIRST0:SH2027223711 wrong password @@ -42,7 +42,7 @@ class DeserializersXmlIdentTest < ActiveSupport::TestCase - + 37605030299 dGVzdCBmYWlsCg== @@ -60,10 +60,10 @@ class DeserializersXmlIdentTest < ActiveSupport::TestCase def test_returns_complete_hash_when_valid xml_string = <<-XML - + - + FIRST0:SH2027223711 wrong password @@ -71,7 +71,7 @@ class DeserializersXmlIdentTest < ActiveSupport::TestCase - + 37605030299 dGVzdCBmYWlsCg== diff --git a/test/lib/deserializers/xml/legal_document_test.rb b/test/lib/deserializers/xml/legal_document_test.rb index bc4dec080..ad39ca882 100644 --- a/test/lib/deserializers/xml/legal_document_test.rb +++ b/test/lib/deserializers/xml/legal_document_test.rb @@ -5,10 +5,10 @@ class DeserializersXmlLegalDocumentTest < ActiveSupport::TestCase def test_returns_nil_when_required_fields_not_present xml_string = <<-XML - + - + john-001 @@ -32,10 +32,10 @@ class DeserializersXmlLegalDocumentTest < ActiveSupport::TestCase def test_returns_hash_when_document_exists xml_string = <<-XML - + - + FIRST0:SH2027223711 wrong password @@ -43,7 +43,7 @@ class DeserializersXmlLegalDocumentTest < ActiveSupport::TestCase - + 37605030299 dGVzdCBmYWlsCg== diff --git a/test/models/epp/response_test.rb b/test/models/epp/response_test.rb index d9d699ba1..e155fb3cf 100644 --- a/test/models/epp/response_test.rb +++ b/test/models/epp/response_test.rb @@ -4,7 +4,7 @@ class EppResponseTest < ActiveSupport::TestCase def test_creates_new_response_from_xml_doc xml = <<-XML - + any