mirror of
https://github.com/internetee/registry.git
synced 2025-07-22 18:56:05 +02:00
request and response have the same domain schema
This commit is contained in:
parent
230fb301a7
commit
6f431232f4
7 changed files with 28 additions and 8 deletions
|
@ -77,12 +77,12 @@ class EppDomainInfoBaseTest < EppTestCase
|
|||
post epp_info_path, params: { frame: request_xml },
|
||||
headers: { 'HTTP_COOKIE' => 'session=api_bestnames' }
|
||||
|
||||
response_xml = Nokogiri::XML(response.body)
|
||||
assert_epp_response :completed_successfully
|
||||
schema = EPP_ALL_SCHEMA
|
||||
|
||||
schema_validation_errors = schema.validate(response_xml)
|
||||
assert_equal 0, schema_validation_errors.size
|
||||
res = parsing_schemas_prefix_and_version(response.body)
|
||||
|
||||
assert_equal res[:prefix], 'domain-eis'
|
||||
assert_equal res[:version], '1.0'
|
||||
end
|
||||
|
||||
def test_returns_valid_response_if_disputed
|
||||
|
|
|
@ -95,4 +95,10 @@ class EppTestCase < ActionDispatch::IntegrationTest
|
|||
raise Exception.new('Wrong prefix')
|
||||
end
|
||||
end
|
||||
|
||||
# The prefix and version of the response are returned are these variants - res[:prefix] res[:version]
|
||||
def parsing_schemas_prefix_and_version(response)
|
||||
xml = response.gsub!(/(?<=>)(.*?)(?=<)/, &:strip)
|
||||
xml.to_s.match(/xmlns:domain=\"https:\/\/epp.tld.ee\/schema\/(?<prefix>\w+-\w+)-(?<version>\w.\w).xsd/)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue