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:59 -0700 |
commit | a32d3d0ad9802c6c10c767506afb0aa13c6565a6 (patch) | |
tree | 640402182bb52183b513528d948390d72d7d459c | |
parent | f2e65b7d54c3034b35a5f248f2482e760cd85cd5 (diff) | |
download | rails-a32d3d0ad9802c6c10c767506afb0aa13c6565a6.tar.gz rails-a32d3d0ad9802c6c10c767506afb0aa13c6565a6.tar.bz2 rails-a32d3d0ad9802c6c10c767506afb0aa13c6565a6.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))' } |