mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Add a test which ensures action_dispatch.show_exceptions is properly disabled.
This commit is contained in:
parent
d898a4ba42
commit
997e22c275
3 changed files with 8 additions and 4 deletions
|
@ -7,7 +7,7 @@ module ActionDispatch
|
|||
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.
|
||||
|
|
|
@ -263,9 +263,7 @@ module ActionDispatch
|
|||
"HTTP_HOST" => host,
|
||||
"REMOTE_ADDR" => remote_addr,
|
||||
"CONTENT_TYPE" => "application/x-www-form-urlencoded",
|
||||
"HTTP_ACCEPT" => accept,
|
||||
|
||||
"action_dispatch.show_exceptions" => false
|
||||
"HTTP_ACCEPT" => accept
|
||||
}
|
||||
|
||||
(rack_environment || {}).each do |key, value|
|
||||
|
|
|
@ -52,6 +52,12 @@ module ApplicationTests
|
|||
assert !middleware.include?("ActionDispatch::Static")
|
||||
end
|
||||
|
||||
test "removes show exceptions if action_dispatch.show_exceptions is disabled" do
|
||||
add_to_config "config.action_dispatch.show_exceptions = false"
|
||||
boot!
|
||||
assert !middleware.include?("ActionDispatch::ShowExceptions")
|
||||
end
|
||||
|
||||
test "use middleware" do
|
||||
use_frameworks []
|
||||
add_to_config "config.middleware.use Rack::Config"
|
||||
|
|
Loading…
Reference in a new issue