mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Rescue hack was supposed to be removed. Some how it crept back in.
This commit is contained in:
parent
98eaa2c683
commit
c3319504f0
4 changed files with 2 additions and 10 deletions
|
@ -368,9 +368,8 @@ module ActionController #:nodoc:
|
|||
attr_reader :template
|
||||
|
||||
def action(name, env)
|
||||
# HACK: For global rescue to have access to the original request and response
|
||||
request = env["action_controller.rescue.request"] ||= ActionDispatch::Request.new(env)
|
||||
response = env["action_controller.rescue.response"] ||= ActionDispatch::Response.new
|
||||
request = ActionDispatch::Request.new(env)
|
||||
response = ActionDispatch::Response.new
|
||||
self.action_name = name && name.to_s
|
||||
process(request, response).to_a
|
||||
end
|
||||
|
|
|
@ -132,9 +132,6 @@ module ActionController #:nodoc:
|
|||
@request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash
|
||||
build_request_uri(action, parameters)
|
||||
|
||||
@request.env["action_controller.rescue.request"] = @request
|
||||
@request.env["action_controller.rescue.response"] = @response
|
||||
|
||||
Base.class_eval { include ProcessWithTest } unless Base < ProcessWithTest
|
||||
|
||||
env = @request.env
|
||||
|
|
|
@ -607,7 +607,6 @@ class FilterTest < Test::Unit::TestCase
|
|||
def test_dynamic_dispatch
|
||||
%w(foo bar baz).each do |action|
|
||||
request = ActionController::TestRequest.new
|
||||
request.env["action_controller.rescue.request"] = request
|
||||
request.query_parameters[:choose] = action
|
||||
response = DynamicDispatchController.action.call(request.env).last
|
||||
assert_equal action, response.body
|
||||
|
|
|
@ -104,7 +104,6 @@ class HelperTest < Test::Unit::TestCase
|
|||
|
||||
def call_controller(klass, action)
|
||||
request = ActionController::TestRequest.new
|
||||
request.env["action_controller.rescue.request"] = request
|
||||
klass.action(action).call(request.env)
|
||||
end
|
||||
|
||||
|
@ -112,7 +111,6 @@ class HelperTest < Test::Unit::TestCase
|
|||
assert_equal 'hello: Iz guuut!',
|
||||
call_controller(Fun::GamesController, "render_hello_world").last.body
|
||||
# request = ActionController::TestRequest.new
|
||||
# request.env["action_controller.rescue.request"] = request
|
||||
#
|
||||
# resp = Fun::GamesController.action(:render_hello_world).call(request.env)
|
||||
# assert_equal 'hello: Iz guuut!', resp.last.body
|
||||
|
@ -217,7 +215,6 @@ class IsolatedHelpersTest < Test::Unit::TestCase
|
|||
|
||||
def call_controller(klass, action)
|
||||
request = ActionController::TestRequest.new
|
||||
request.env["action_controller.rescue.request"] = request
|
||||
klass.action(action).call(request.env)
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue