diff --git a/test/integration/epp/domain/info/base_test.rb b/test/integration/epp/domain/info/base_test.rb index ed7693640..5f44248aa 100644 --- a/test/integration/epp/domain/info/base_test.rb +++ b/test/integration/epp/domain/info/base_test.rb @@ -25,8 +25,11 @@ class EppDomainInfoBaseTest < EppTestCase headers: { 'HTTP_COOKIE' => 'session=api_bestnames' } response_xml = Nokogiri::XML(response.body) - p response_xml + + schema_version = return_xml_domain_schema_version(response_xml) + assert_epp_response :completed_successfully + assert schema_version >= 1.1 assert_equal 'shop.test', response_xml.at_xpath('//domain:name', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text assert_equal 'ok', response_xml.at_xpath('//domain:status', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}")['s'] assert_equal 'john-001', response_xml.at_xpath('//domain:registrant', 'domain' => "#{Xsd::Schema.filename(for_prefix: 'domain-eis')}").text diff --git a/test/lib/xsd_schema/xsd_schema_test.rb b/test/lib/xsd_schema/xsd_schema_test.rb index 0d3e30103..ac5868746 100644 --- a/test/lib/xsd_schema/xsd_schema_test.rb +++ b/test/lib/xsd_schema/xsd_schema_test.rb @@ -18,4 +18,5 @@ class XsdSchemaTest < ActiveSupport::TestCase assert_equal Xsd::Schema::BASE_URL + 'abcde-fghij-1.3.xsd', filename end + end diff --git a/test/test_helper.rb b/test/test_helper.rb index df2e9878e..addeede90 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -22,7 +22,6 @@ require 'sidekiq/testing' Sidekiq::Testing.fake! - # `bin/rails test` is not the same as `bin/rake test`. # All tasks will be loaded (and executed) twice when using the former without `Rake::Task.clear`. # https://github.com/rails/rails/issues/28786 @@ -69,4 +68,13 @@ end class EppTestCase < ActionDispatch::IntegrationTest include Assertions::EppAssertions + + def return_xml_domain_schema_version(response_xml) + version_regex = /-\d+\S\d+/ + domain_schema_tag = response_xml.to_s.scan(/xmlns:domain\S+/) + schema_path = domain_schema_tag.to_s.match(%r{https?://\S+})[0] + version = schema_path.to_s.match(version_regex)[0] + + -version.to_f + end end