aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/route_set.rb
diff options
context:
space:
mode:
authorBrian Hahn <brian.hahn@crowdflower.com>2013-09-04 16:43:36 -0700
committerBrian Hahn <brian.hahn@crowdflower.com>2013-09-06 11:08:41 -0700
commit03ac291526b04586a0f0db0f531f18f14be792c6 (patch)
tree0a9e5bf5973002ce97c85dc75fbe84358edf977e /actionpack/lib/action_dispatch/routing/route_set.rb
parent59a35610459da7368e79179c9d33bc6e4697adb1 (diff)
downloadrails-03ac291526b04586a0f0db0f531f18f14be792c6.tar.gz
rails-03ac291526b04586a0f0db0f531f18f14be792c6.tar.bz2
rails-03ac291526b04586a0f0db0f531f18f14be792c6.zip
pass the extra params to the rack test environment so that routes with block constraints have access
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route_set.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb3
1 files changed, 2 insertions, 1 deletions
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