diff options
author | Rolf Bjaanes <rolf@powow.no> | 2010-04-02 20:00:29 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-02 20:47:42 +0200 |
commit | d898a4ba425a201827f07a5bb11c8c6bf85159b8 (patch) | |
tree | 8d36c58c4b0adeed0101ab2eff3a68b9deab9ee2 /railties | |
parent | 13eb2c87e6b8296ca2ce2da36eb746e2b94a563b (diff) | |
download | rails-d898a4ba425a201827f07a5bb11c8c6bf85159b8.tar.gz rails-d898a4ba425a201827f07a5bb11c8c6bf85159b8.tar.bz2 rails-d898a4ba425a201827f07a5bb11c8c6bf85159b8.zip |
Raise exceptions instead of rendering error templates in test environment [#4315 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/application/configuration.rb | 2 | ||||
-rw-r--r-- | railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/railties/lib/rails/application/configuration.rb b/railties/lib/rails/application/configuration.rb index 44635ff4f6..5c7de616be 100644 --- a/railties/lib/rails/application/configuration.rb +++ b/railties/lib/rails/application/configuration.rb @@ -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 }) diff --git a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt index 0b87b241ec..beb28e2229 100644 --- a/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt +++ b/railties/lib/rails/generators/rails/app/templates/config/environments/test.rb.tt @@ -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 |