diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-22 18:04:22 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-12-22 18:04:22 -0700 |
commit | 4ee537a8a21ecab2a4d0c8e6a6730a72a7937428 (patch) | |
tree | bc56bb8d646238d4096af11231e16002d5448547 | |
parent | 967490badfb7163d653a75bf0637f66e78883f9e (diff) | |
download | rails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.tar.gz rails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.tar.bz2 rails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.zip |
Adding an integration test. Fixes #4136
-rw-r--r-- | actionpack/test/controller/routing_test.rb | 9 |
1 files changed, 9 insertions, 0 deletions
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))' } |