This project is archived and is in readonly mode.
Glob parameters in route ignore regexp requirements
-
Andrew White
- Milestone cleared.
- State changed from new to open
- Assigned user set to José Valim
Patch posted inline as LH attachments appear to be broken
From 38613c364f4025912fbd0923b2d872851db50176 Mon Sep 17 00:00:00 2001 From: Andrew White <andyw@pixeltrix.co.uk> Date: Fri, 25 Jun 2010 14:38:17 +0100 Subject: [PATCH] Failing test for whether glob parameters accept regexps --- actionpack/test/dispatch/routing_test.rb | 12 ++++++++++++ 1 files changed, 12 insertions(+), 0 deletions(-) diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index 8f43b5f..04577a1 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -314,6 +314,8 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest post :preview end end + + match '/:locale/*file.:format', :to => 'files#show', :file => /path\/to\/existing\/file/ end end @@ -1421,6 +1423,16 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest end end + def test_glob_parameter_accepts_regexp + with_test_routes do + get '/en/path/to/existing/file.html' + assert_equal 200, @response.status + + get '/en/path/to/missing/file.html' + assert_equal 404, @response.status + end + end + private def with_test_routes yield -- 1.7.1 -
Jeremy Kemper
- State changed from open to resolved