mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-21 14:18:36 +00:00
Add match_json_values and use in AP worker specs (#30720)
This commit is contained in:
@@ -6,3 +6,14 @@ RSpec::Matchers.define :match_json_schema do |schema|
|
||||
JSON::Validator.validate(schema_path, input_json, validate_schema: true)
|
||||
end
|
||||
end
|
||||
|
||||
RSpec::Matchers.define :match_json_values do |values|
|
||||
match do |string|
|
||||
expect(json_str_to_hash(string))
|
||||
.to include(values)
|
||||
end
|
||||
|
||||
failure_message do |value|
|
||||
"expected that #{value} would have the same values as #{values}."
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user