mirror of
https://github.com/internetee/registry.git
synced 2025-06-10 06:34:46 +02:00
added method in test_helper & updated method for compare schema version
This commit is contained in:
parent
ecd2bc9fa6
commit
a747aa3c0f
3 changed files with 14 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue