Skip to content

Commit 99c05e0

Browse files
committed
Add failing test about matching request path with trailing slash
1 parent e60e199 commit 99c05e0

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

spec/router_spec.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,16 @@
2727
expect(match.params).to eq('id' => 'b')
2828
end
2929

30+
it 'matches a static path with trailing slash' do
31+
match = router.match('PATCH', '/a/')
32+
expect(match.request_definition).to be(requests[2])
33+
end
34+
35+
it 'matches a dynamic path with trailing slash' do
36+
match = router.match('PATCH', '/id/')
37+
expect(match.request_definition).to be(requests[1])
38+
end
39+
3040
it 'returns an incomplete match for unknown path' do
3141
expect(router.match('GET', '/c/d').error).to have_attributes(type: :not_found)
3242
end

0 commit comments

Comments
 (0)