aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/routing_test.rb
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2010-08-31 17:42:30 +0100
committerSantiago Pastorino <santiago@wyeworks.com>2010-08-31 21:16:21 -0300
commit6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df (patch)
treea41e1a5fd80c24214f86efc9d001290164cadddd /actionpack/test/dispatch/routing_test.rb
parent8b2e4fddbf7e9d204579cd87ac72f14bc592d5a5 (diff)
downloadrails-6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df.tar.gz
rails-6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df.tar.bz2
rails-6c3f5eb76c2277e8a8e94d8c7d8942dc2d11a3df.zip
Bump rack-mount to 0.6.13 and add test case for named character classes [#5509 state:resolved]
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'actionpack/test/dispatch/routing_test.rb')
-rw-r--r--actionpack/test/dispatch/routing_test.rb12
1 files changed, 12 insertions, 0 deletions
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