From 03ac291526b04586a0f0db0f531f18f14be792c6 Mon Sep 17 00:00:00 2001 From: Brian Hahn Date: Wed, 4 Sep 2013 16:43:36 -0700 Subject: pass the extra params to the rack test environment so that routes with block constraints have access --- actionpack/lib/action_dispatch/routing/route_set.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb') diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 6e63f92ff3..d9671a4932 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -611,9 +611,10 @@ module ActionDispatch def recognize_path(path, environment = {}) method = (environment[:method] || "GET").to_s.upcase path = Journey::Router::Utils.normalize_path(path) unless path =~ %r{://} + extras = environment[:extras] || {} begin - env = Rack::MockRequest.env_for(path, {:method => method}) + env = Rack::MockRequest.env_for(path, {:method => method, :params => extras}) rescue URI::InvalidURIError => e raise ActionController::RoutingError, e.message end -- cgit v1.2.3