From 3300fdedc748993b378288c6cbc3113885c955ed Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Mon, 4 Aug 2014 18:20:07 -0700 Subject: avoid testing only_path we know that this call only wants the path returned, so lets call a method that returns the path. --- actionpack/lib/action_controller/test_case.rb | 3 +-- actionpack/lib/action_dispatch/routing/route_set.rb | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'actionpack/lib') diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index 71cb224f22..9d0ec6f4de 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -695,12 +695,11 @@ module ActionController unless @request.env["PATH_INFO"] options = @controller.respond_to?(:url_options) ? @controller.__send__(:url_options).merge(parameters) : parameters options.update( - :only_path => true, :action => action, :relative_url_root => nil, :_recall => @request.path_parameters) - url, query_string = @routes.url_for(options).split("?", 2) + url, query_string = @routes.path_for(options).split("?", 2) @request.env["SCRIPT_NAME"] = @controller.config.relative_url_root @request.env["PATH_INFO"] = url diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index ce1fe2e451..5b3651aaee 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -697,6 +697,10 @@ module ActionDispatch options.delete(:script_name) { '' } end + def path_for(options, route_name = nil) # :nodoc: + url_for(options, route_name, PATH) + end + # The +options+ argument must be a hash whose keys are *symbols*. def url_for(options, route_name = nil, url_strategy = UNKNOWN) options = default_url_options.merge options -- cgit v1.2.3