diff options
author | Matt Fawcett <mail@matthewfawcett.co.uk> | 2012-02-24 13:16:31 +0000 |
---|---|---|
committer | Matt Fawcett <mail@matthewfawcett.co.uk> | 2012-02-24 13:16:31 +0000 |
commit | d7bf930df5f508a0a201c8511376fb62fa22ff68 (patch) | |
tree | b6840e594da4ccc6046f4df6eb2012018e140b30 /actionpack/lib/action_dispatch/routing | |
parent | 335fac56b671cd627ed55cbd41a62d3890342de4 (diff) | |
download | rails-d7bf930df5f508a0a201c8511376fb62fa22ff68.tar.gz rails-d7bf930df5f508a0a201c8511376fb62fa22ff68.tar.bz2 rails-d7bf930df5f508a0a201c8511376fb62fa22ff68.zip |
Fix the assert_recognizes test method so that it works when there are
constraints on the querystring. Issue #2781
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route_set.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb index 57c6972078..0ec4e41470 100644 --- a/actionpack/lib/action_dispatch/routing/route_set.rb +++ b/actionpack/lib/action_dispatch/routing/route_set.rb @@ -594,6 +594,7 @@ 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}) @@ -603,6 +604,7 @@ module ActionDispatch req = @request_class.new(env) @router.recognize(req) do |route, matches, params| + params.merge!(extras) params.each do |key, value| if value.is_a?(String) value = value.dup.force_encoding(Encoding::BINARY) |