Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-12 03:10:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-12 03:10:27 +0300
commita160c4b1a72105a751cdc2f9f973dbe39a1c0dfd (patch)
tree8383dcf5249407b3301289415ed9c3daccd43057 /spec/support/matchers
parent0ae8428c8e77d5d7e098827be688b1f146321af1 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/support/matchers')
-rw-r--r--spec/support/matchers/schema_matcher.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/support/matchers/schema_matcher.rb b/spec/support/matchers/schema_matcher.rb
index e8a7964b820..94e4359b1dd 100644
--- a/spec/support/matchers/schema_matcher.rb
+++ b/spec/support/matchers/schema_matcher.rb
@@ -45,6 +45,15 @@ RSpec::Matchers.define :match_response_schema do |schema, dir: nil, **options|
end
end
+RSpec::Matchers.define :match_snowplow_schema do |schema, dir: nil, **options|
+ match do |data|
+ schema_path = Pathname.new(Rails.root.join(dir.to_s, 'spec', "fixtures/product_intelligence/#{schema}.json").to_s)
+ validator = SchemaPath.validator(schema_path)
+
+ validator.valid?(data.stringify_keys)
+ end
+end
+
RSpec::Matchers.define :match_schema do |schema, dir: nil, **options|
match do |data|
schema = SchemaPath.expand(schema, dir)