1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Uncommented request.recycle! as it breaks more than it fixes, left test case in, xal?

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1572 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-06-30 14:49:36 +00:00
parent 4cd5b05377
commit 524d1b5e04
5 changed files with 29 additions and 9 deletions

View file

@ -72,12 +72,20 @@ module ActionController #:nodoc:
extra_keys = ActionController::Routing::Routes.extra_keys(parameters)
non_path_parameters = get? ? query_parameters : request_parameters
parameters.each do |key, value|
if extra_keys.include?(key.to_sym) then non_path_parameters[key] = value
else path_parameters[key] = value.to_s
if extra_keys.include?(key.to_sym)
non_path_parameters[key] = value
else
path_parameters[key] = value.to_s
end
end
end
def recycle!
self.request_parameters = {}
self.query_parameters = {}
self.path_parameters = {}
end
private
def initialize_containers
@env, @cookies = {}, {}
@ -257,6 +265,7 @@ module Test
@request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash
build_request_uri(action, parameters)
@controller.process(@request, @response)
# @request.recycle!
end
# execute the request simulating a specific http method and set/volley the response

View file

@ -33,6 +33,10 @@ class TestTest < Test::Unit::TestCase
</html>
HTML
end
def test_only_one_param
render :text => (@params[:left] && @params[:right]) ? "EEP, Both here!" : "OK"
end
end
def setup
@ -72,6 +76,13 @@ HTML
assert_equal "/explicit/uri", @response.body
end
def test_multiple_calls
process :test_only_one_param, :left => true
assert_equal "OK", @response.body
process :test_only_one_param, :right => true
assert_equal "OK", @response.body
end
def test_assert_tag
process :test_html_output