summaryrefslogtreecommitdiff
path: root/spec/support/api
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-16 11:13:21 -0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2016-08-17 12:58:59 -0300
commit29a91c5bc65524fffeaaba493f30c419b98f0869 (patch)
tree8d74bd6804a33158c9923684e5140285cc461ca5 /spec/support/api
parentf77c47a51c8fef379b2dc9473545e53a28ec3c7f (diff)
downloadgitlab-ce-29a91c5bc65524fffeaaba493f30c419b98f0869.tar.gz
Fix matcher `match_response_schema`
Diffstat (limited to 'spec/support/api')
-rw-r--r--spec/support/api/schema_matcher.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/spec/support/api/schema_matcher.rb b/spec/support/api/schema_matcher.rb
index 929b637e5eb..e42d727672b 100644
--- a/spec/support/api/schema_matcher.rb
+++ b/spec/support/api/schema_matcher.rb
@@ -1,9 +1,8 @@
-RSpec::Matchers.define :match_response_schema do |schema, options = {}|
+RSpec::Matchers.define :match_response_schema do |schema, **options|
match do |response|
schema_directory = "#{Dir.pwd}/spec/fixtures/api/schemas"
schema_path = "#{schema_directory}/#{schema}.json"
- list = options.fetch(:array, false)
- JSON::Validator.validate!(schema_path, response.body, list: list)
+ JSON::Validator.validate!(schema_path, response.body, options)
end
end