-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,11 @@ def test_that_assert_with_a_hyper_schema | |
assert_response_schema('hyper_schema.json') | ||
end | ||
|
||
def test_simple_json_pointers | ||
get :show | ||
assert_response_schema('simple_json_pointers.json') | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
maurogeorge
Author
Owner
|
||
end | ||
|
||
def test_that_assert_with_a_custom_schema_directory | ||
original_schema_path = ActiveModel::Serializer.config.schema_path | ||
ActiveModel::Serializer.config.schema_path = 'test/support/custom_schemas' | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"properties": { | ||
"name": { | ||
"$ref": "test/support/schemas/custom/show.json#/properties/name" | ||
}, | ||
"description": { | ||
"$ref": "test/support/schemas/custom/show.json#/properties/description" | ||
} | ||
} | ||
} |
One last thought: We've found on
json_matchers
that it's useful to test the negative case because sometimes pointers aren't dereferenced as expected and we get false positives when we only test the "happy path". This RSpec test is a good example of what I'm suggesting.