From a32d3d0ad9802c6c10c767506afb0aa13c6565a6 Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Thu, 22 Dec 2011 18:04:22 -0700 Subject: Adding an integration test. Fixes #4136 --- actionpack/test/controller/routing_test.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'actionpack/test/controller') diff --git a/actionpack/test/controller/routing_test.rb b/actionpack/test/controller/routing_test.rb index 715cc229e1..715010d7f7 100644 --- a/actionpack/test/controller/routing_test.rb +++ b/actionpack/test/controller/routing_test.rb @@ -139,6 +139,15 @@ class LegacyRouteSetTests < Test::Unit::TestCase assert_equal 'clients', get(URI('http://clients.example.org/')) end + def test_empty_string_match + rs.draw do + get '/:username', :constraints => { :username => /[^\/]+/ }, + :to => lambda { |e| [200, {}, ['foo']] } + end + assert_equal 'Not Found', get(URI('http://example.org/')) + assert_equal 'foo', get(URI('http://example.org/hello')) + end + def test_draw_with_block_arity_one_raises assert_raise(RuntimeError) do @rs.draw { |map| map.match '/:controller(/:action(/:id))' } -- cgit v1.2.3