提交 4ee537a8 编写于 作者: A Aaron Patterson

Adding an integration test. Fixes #4136

上级 967490ba
......@@ -139,6 +139,15 @@ def test_lambda_constraints
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))' }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册