mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-18 14:11:10 +00:00
Fix conference serializer spec to work with MySQL
This commit is contained in:
parent
9eb4ac2738
commit
4d6868d9bb
5 changed files with 125 additions and 73 deletions
9
spec/support/api_schema_matcher.rb
Normal file
9
spec/support/api_schema_matcher.rb
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
# Source: https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher
|
||||
|
||||
RSpec::Matchers.define :match_response_schema do |schema|
|
||||
match do |json|
|
||||
schema_directory = "#{Dir.pwd}/spec/support/schemas"
|
||||
schema_path = "#{schema_directory}/#{schema}.json"
|
||||
JSON::Validator.validate!(schema_path, json, strict: true)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue