Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to ignore empty captures from params #1390

Merged
merged 2 commits into from
Feb 21, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add filtered and returns empty params test
  • Loading branch information
iguchi1124 committed Feb 20, 2018
commit 06f8c839a1f35f844a93f6cf9c8642c2b954cb34
15 changes: 15 additions & 0 deletions test/routing_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down