travis-api/spec/unit
Piotr Sarnacki 61142c7cf6 Return 404 unless we can find API builder for resource
In order to protect us from rendering a resource simply converted to
json, without processing it with API data class, this commit changes
JSON responder behavior to render 404 if we can't find associated data
class. The only exception to that rule is when resource is already a
Hash, meaning that it was processed before - we sometimes return for
example simple Hash responses like { result: true }.

The Hash exception could allow to accidentally pass resource.as_json to
responder, but in travis-ci/travis-support@124b8b6 I disabled default
as_json method on AR::Base classes, so the risk of such mistake is
lowered.
2013-03-24 19:49:28 +01:00
..
endpoint Load the data for integration tests upfront 2013-01-26 00:00:42 +01:00
extensions pass if scope does not match 2013-01-13 20:08:56 +01:00
helpers Allow to pass version as Accept param 2013-02-25 17:28:24 +01:00
middleware add travis_token scope 2012-12-12 17:11:25 +01:00
responders Return 404 unless we can find API builder for resource 2013-03-24 19:49:28 +01:00
app_spec.rb start porting api integration tests 2012-10-02 16:39:38 +02:00
cors_spec.rb Move CORS middleware in front of the stack 2012-11-05 21:48:13 +01:00
default_spec.rb start porting api integration tests 2012-10-02 16:39:38 +02:00
endpoint_spec.rb start porting api integration tests 2012-10-02 16:39:38 +02:00
middleware_spec.rb start porting api integration tests 2012-10-02 16:39:38 +02:00