From 6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df Mon Sep 17 00:00:00 2001 From: Andrew White Date: Tue, 31 Aug 2010 17:42:30 +0100 Subject: Bump rack-mount to 0.6.13 and add test case for named character classes [#5509 state:resolved] Signed-off-by: Santiago Pastorino --- actionpack/test/dispatch/routing_test.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'actionpack/test') diff --git a/actionpack/test/dispatch/routing_test.rb b/actionpack/test/dispatch/routing_test.rb index a4b8fafa78..0eee63e94f 100644 --- a/actionpack/test/dispatch/routing_test.rb +++ b/actionpack/test/dispatch/routing_test.rb @@ -442,6 +442,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest get :preview, :on => :member end + match '/purchases/:token/:filename', + :to => 'purchases#fetch', + :token => /[[:alnum:]]{10}/, + :filename => /(.+)/, + :as => :purchase + scope '/countries/:country', :constraints => lambda { |params, req| %[all France].include?(params[:country]) } do match '/', :to => 'countries#index' match '/cities', :to => 'countries#cities' @@ -2098,6 +2104,12 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest assert_equal '/customers/1/export', customer_export_path(:customer_id => '1') end + def test_named_character_classes_in_regexp_constraints + get '/purchases/315004be7e/Ruby_on_Rails_3.pdf' + assert_equal 'purchases#fetch', @response.body + assert_equal '/purchases/315004be7e/Ruby_on_Rails_3.pdf', purchase_path(:token => '315004be7e', :filename => 'Ruby_on_Rails_3.pdf') + end + private def with_test_routes yield -- cgit v1.2.3