Permalink
Browse files

Rolled back changed to test_process as it broke havok this morning

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1562 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 2d86799 commit 571abe8d5e8bd8df8a891bfb214e129cc97cf4a3 @dhh dhh committed Jun 29, 2005
Showing with 12 additions and 13 deletions.
  1. +12 −13 actionpack/lib/action_controller/test_process.rb
@@ -66,11 +66,10 @@ def request_uri
def path
@path || super()
end
-
- def generate_route_and_assign_parameters(controller_path, action, parameters)
- parameters = parameters.symbolize_keys.merge(:controller => controller_path, :action => action)
- path, extras = ActionController::Routing::Routes.generate(parameters)
- non_path_parameters = get? ? query_parameters : request_parameters
+
+ def assign_parameters(parameters)
+ path, extras = ActionController::Routing::Routes.generate(parameters.symbolize_keys)
+ non_path_parameters = (get? ? query_parameters : request_parameters)
parameters.each do |key, value|
(extras.key?(key.to_sym) ? non_path_parameters : path_parameters)[key] = value
end
@@ -249,7 +248,9 @@ def process(action, parameters = nil, session = nil, flash = nil)
@request.action = action.to_s
parameters ||= {}
- @request.generate_route_and_assign_parameters(@controller.class.controller_path, action.to_s, parameters)
+ parameters[:controller] = @controller.class.controller_path
+ parameters[:action] = action.to_s
+ @request.assign_parameters(parameters)
@request.session = ActionController::TestSession.new(session) unless session.nil?
@request.session["flash"] = ActionController::Flash::FlashHash.new.update(flash) if flash
@@ -306,13 +307,11 @@ def redirect_to_url
end
def build_request_uri(action, parameters)
- unless @request.env['REQUEST_URI']
- options = @controller.send(:rewrite_options, parameters)
- options.update(:only_path => true, :action => action)
-
- url = ActionController::UrlRewriter.new(@request, parameters)
- @request.set_REQUEST_URI(url.rewrite(options))
- end
+ return if @request.env['REQUEST_URI']
+ url = ActionController::UrlRewriter.new(@request, parameters)
+ @request.set_REQUEST_URI(
+ url.rewrite(@controller.send(:rewrite_options,
+ (parameters||{}).update(:only_path => true, :action=>action))))
end
def html_document

0 comments on commit 571abe8

Please sign in to comment.