From 06f8c839a1f35f844a93f6cf9c8642c2b954cb34 Mon Sep 17 00:00:00 2001 From: Shota Iguchi Date: Wed, 21 Feb 2018 00:10:40 +0900 Subject: [PATCH] Add filtered and returns empty params test --- test/routing_test.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/test/routing_test.rb b/test/routing_test.rb index 621b78e3..f9cc81ad 100644 --- a/test/routing_test.rb +++ b/test/routing_test.rb @@ -216,6 +216,21 @@ class RoutingTest < Minitest::Test assert_equal "This is not a drill either", response.body end + it "returns empty when unmatched with any regex captures" do + mock_app do + before do + # noop + end + + get '/hello' do + params.to_s + end + end + + assert get('/hello').ok? + assert_body '{}' + end + it "uses 404 error handler for not matching route" do mock_app { not_found do