diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2013-09-10 13:23:57 -0700 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2013-09-10 13:23:57 -0700 |
commit | cff8d1d24da1237a2f4d44e46f5ec486cd6ba32d (patch) | |
tree | 5ca90edd845be7afa673991cfa7084cc71174aa1 /actionpack/lib/action_dispatch/testing | |
parent | 143e00954619f3ce86e08f72ba7927c6f8991062 (diff) | |
parent | 03ac291526b04586a0f0db0f531f18f14be792c6 (diff) | |
download | rails-cff8d1d24da1237a2f4d44e46f5ec486cd6ba32d.tar.gz rails-cff8d1d24da1237a2f4d44e46f5ec486cd6ba32d.tar.bz2 rails-cff8d1d24da1237a2f4d44e46f5ec486cd6ba32d.zip |
Merge pull request #9368 from CrowdFlower/3-2-stable
PR #5219 backported to 3-2
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/assertions/routing.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index b10aab9029..2a25d3fcc6 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -39,7 +39,7 @@ module ActionDispatch # # Test a custom route # assert_recognizes({:controller => 'items', :action => 'show', :id => '1'}, 'view/item1') def assert_recognizes(expected_options, path, extras={}, message=nil) - request = recognized_request_for(path) + request = recognized_request_for(path, extras) expected_options = expected_options.clone extras.each_key { |key| expected_options.delete key } unless extras.nil? @@ -179,7 +179,7 @@ module ActionDispatch private # Recognizes the route for a given path. - def recognized_request_for(path) + def recognized_request_for(path, extras = {}) if path.is_a?(Hash) method = path[:method] path = path[:path] @@ -207,7 +207,7 @@ module ActionDispatch request.request_method = method if method - params = @routes.recognize_path(path, { :method => method }) + params = @routes.recognize_path(path, { :method => method, :extras => extras }) request.path_parameters = params.with_indifferent_access request |