aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/routing_test.rb
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2011-12-22 18:04:22 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2011-12-22 18:04:22 -0700
commit4ee537a8a21ecab2a4d0c8e6a6730a72a7937428 (patch)
treebc56bb8d646238d4096af11231e16002d5448547 /actionpack/test/controller/routing_test.rb
parent967490badfb7163d653a75bf0637f66e78883f9e (diff)
downloadrails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.tar.gz
rails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.tar.bz2
rails-4ee537a8a21ecab2a4d0c8e6a6730a72a7937428.zip
Adding an integration test. Fixes #4136
Diffstat (limited to 'actionpack/test/controller/routing_test.rb')
-rw-r--r--actionpack/test/controller/routing_test.rb9
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))' }