Sha256: c6a9b5a751474bc1e190510bef20bf2519737c252b49d0e32d17a6ffbe996121

Contents?: true

Size: 574 Bytes

Versions: 44

Compression:

Stored size: 574 Bytes

Contents

prepend Respond, Actions

# If the request doesn't match application/json specifically, it would be passed through:
respond.with_passthrough
respond.with_json

# The reason why this test is important is that it tests the behaviour of error handling. Normally, if a request comes into the middleware and fails due to an unhandled exception, this is passed along by Utopia::ExceptionHandler. If the client is expecting JSON, they should get a JSON error response.
on 'file-not-found' do
	fail! 404, {message: 'File not found'}
end

# Accept: text/html, application/json, */*

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
utopia-2.3.0 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.2.0 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.1.2 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.1.1 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.1.0 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.11 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.0.3 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.0.2 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.0.1 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-2.0.0 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.10 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.9 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.7 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.6 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.5 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.4 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.3 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.2 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.1 spec/utopia/controller/respond_spec/errors/controller.rb
utopia-1.9.0 spec/utopia/controller/respond_spec/errors/controller.rb