mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Raise exceptions instead of rendering error templates in test environment [#4315 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
This commit is contained in:
parent
13eb2c87e6
commit
d898a4ba42
3 changed files with 6 additions and 2 deletions
|
@ -6,7 +6,8 @@ module ActionDispatch
|
|||
config.action_dispatch = ActiveSupport::OrderedOptions.new
|
||||
config.action_dispatch.x_sendfile_header = ""
|
||||
config.action_dispatch.ip_spoofing_check = true
|
||||
|
||||
config.action_dispatch.show_exceptions = true
|
||||
|
||||
# Prepare dispatcher callbacks and run 'prepare' callbacks
|
||||
initializer "action_dispatch.prepare_dispatcher" do |app|
|
||||
# TODO: This used to say unless defined?(Dispatcher). Find out why and fix.
|
||||
|
|
|
@ -132,7 +132,7 @@ module Rails
|
|||
middleware.use('::Rack::Lock', :if => lambda { !allow_concurrency })
|
||||
middleware.use('::Rack::Runtime')
|
||||
middleware.use('::Rails::Rack::Logger')
|
||||
middleware.use('::ActionDispatch::ShowExceptions', lambda { consider_all_requests_local })
|
||||
middleware.use('::ActionDispatch::ShowExceptions', lambda { consider_all_requests_local }, :if => lambda { action_dispatch.show_exceptions })
|
||||
middleware.use("::ActionDispatch::RemoteIp", lambda { action_dispatch.ip_spoofing_check }, lambda { action_dispatch.trusted_proxies })
|
||||
middleware.use('::Rack::Sendfile', lambda { action_dispatch.x_sendfile_header })
|
||||
middleware.use('::ActionDispatch::Callbacks', lambda { !cache_classes })
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Raise exceptions instead of rendering exception templates
|
||||
config.action_dispatch.show_exceptions = false
|
||||
|
||||
# Disable request forgery protection in test environment
|
||||
config.action_controller.allow_forgery_protection = false
|
||||
|
||||
|
|
Loading…
Reference in a new issue