aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-08-20 17:33:33 +0100
committerJosé Valim <jose.valim@gmail.com>2010-08-20 14:51:25 -0300
commit7c9bf45b0dd7ad7a1d99a14566bfaeadc77b4665 (patch)
tree67c02994f8334d5fe51fa398f7c63f104ef45965 /actionpack/lib/action_dispatch/routing
parent0420fb56475409c209193fbd45f9afffe8cd35eb (diff)
downloadrails-7c9bf45b0dd7ad7a1d99a14566bfaeadc77b4665.tar.gz
rails-7c9bf45b0dd7ad7a1d99a14566bfaeadc77b4665.tar.bz2
rails-7c9bf45b0dd7ad7a1d99a14566bfaeadc77b4665.zip
Support routing constraints in functional tests
Extend assert_recognizes and assert_generates to support passing full urls as the path argument. This allows testing of routing constraints such as subdomain and host within functional tests. [#5005 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index d23b580d97..b531cc1a8e 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -494,7 +494,7 @@ module ActionDispatch
def recognize_path(path, environment = {})
method = (environment[:method] || "GET").to_s.upcase
- path = Rack::Mount::Utils.normalize_path(path)
+ path = Rack::Mount::Utils.normalize_path(path) unless path =~ %r{://}
begin
env = Rack::MockRequest.env_for(path, {:method => method})
@@ -502,7 +502,7 @@ module ActionDispatch
raise ActionController::RoutingError, e.message
end
- req = Rack::Request.new(env)
+ req = @request_class.new(env)
@set.recognize(req) do |route, matches, params|
params.each do |key, value|
if value.is_a?(String)