Method: ActiveModelSerializers::Test::Schema#assert_response_schema

Defined in:
lib/active_model_serializers/test/schema.rb

#assert_response_schema(schema_path = nil, message = nil) ⇒ Boolean, Minitest::Assertion

A Minitest Assertion that test the response is valid against a schema.

Examples:

get :index
assert_response_schema


12
13
14
15
# File 'lib/active_model_serializers/test/schema.rb', line 12

def assert_response_schema(schema_path = nil, message = nil)
  matcher = AssertResponseSchema.new(schema_path, request, response, message)
  assert(matcher.call, matcher.message)
end