diff options
author | Mikel Lindsaar <raasdnil@gmail.com> | 2010-03-11 22:05:15 +1100 |
---|---|---|
committer | Mikel Lindsaar <raasdnil@gmail.com> | 2010-03-11 22:05:15 +1100 |
commit | f5774e3e3f70a3acfa559b9ff889e9417fb71d4b (patch) | |
tree | e738112994d40d6c3792065da80bddfa7439467b /actionpack/lib/action_controller/test_case.rb | |
parent | cefe723e285f20d1f2a33f67da03348568f7e0b0 (diff) | |
parent | 073852dff0b48296a9a184f94e722183334f3c4c (diff) | |
download | rails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.tar.gz rails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.tar.bz2 rails-f5774e3e3f70a3acfa559b9ff889e9417fb71d4b.zip |
Merge branch 'master' of git://github.com/rails/rails
Diffstat (limited to 'actionpack/lib/action_controller/test_case.rb')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 64d9bdab2a..cdb5db32aa 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -322,6 +322,8 @@ module ActionController @controller ||= klass.new rescue nil end + @request.env.delete('PATH_INFO') + if @controller @controller.request = @request @controller.params = {} @@ -335,13 +337,20 @@ module ActionController private def build_request_uri(action, parameters) - unless @request.env['REQUEST_URI'] + unless @request.env["PATH_INFO"] options = @controller.__send__(:url_options).merge(parameters) - options.update(:only_path => true, :action => action) + options.update( + :only_path => true, + :action => action, + :relative_url_root => nil, + :_path_segments => @request.symbolized_path_parameters) + + url, query_string = @router.url_for(options).split("?", 2) - url = ActionController::UrlRewriter.new(@request, parameters) - @request.request_uri = url.rewrite(@router, options) + @request.env["SCRIPT_NAME"] = @controller.config.relative_url_root + @request.env["PATH_INFO"] = url + @request.env["QUERY_STRING"] = query_string || "" end end - end + end end |