mirror of
https://github.com/ditkrg/active_model_serializers.git
synced 2026-01-25 15:23:06 +00:00
Create assert_response_schema test helper
It is a common pattern to use JSON Schema to validate a API response[1], [2] and [3]. This patch creates the `assert_response_schema` test helper that helps people do this kind of validation easily on the controller tests. [1]: https://robots.thoughtbot.com/validating-json-schemas-with-an-rspec-matcher [2]: https://github.com/sharethrough/json-schema-rspec [3]: https://github.com/rails-api/active_model_serializers/issues/1011#issuecomment-127608121
This commit is contained in:
committed by
Benjamin Fleischer
parent
9aed6ac634
commit
5058694f4a
7
test/support/schemas/custom/show.json
Normal file
7
test/support/schemas/custom/show.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"id": "file://custom/show.json#",
|
||||
"properties": {
|
||||
"name" : { "type" : "string" },
|
||||
"description" : { "type" : "string" }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user