File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 153153 racc (~> 1.4 )
154154 nokogiri (1.18.10-x86_64-linux-musl )
155155 racc (~> 1.4 )
156- openapi_parameters (0.7 .0 )
156+ openapi_parameters (0.8 .0 )
157157 rack (>= 2.2 )
158158 parallel (1.27.0 )
159159 parser (3.3.9.0 )
Original file line number Diff line number Diff line change 4141 expect ( router . match ( 'DELETE' , '/b' ) . error ) . to have_attributes ( type : :method_not_allowed )
4242 end
4343
44+ context 'with ambiguous paths' do
45+ let ( :requests ) do
46+ [
47+ double ( path : '/api/{tenant_id}/tickets/extra' , request_method : 'get' ) ,
48+ double ( path : '/api/{tenant_id}/tickets/{id}' , request_method : 'get' )
49+ ]
50+ end
51+
52+ it 'matches the exact path' do
53+ match = router . match ( 'GET' , '/api/42/tickets/extra' )
54+ expect ( match . request_definition . path ) . to eq ( '/api/{tenant_id}/tickets/extra' )
55+ end
56+ end
57+
58+ context 'with ambiguous paths reversed' do
59+ let ( :requests ) do
60+ [
61+ double ( path : '/api/{tenant_id}/tickets/{id}' , request_method : 'get' ) ,
62+ double ( path : '/api/{tenant_id}/tickets/extra' , request_method : 'get' )
63+ ]
64+ end
65+
66+ it 'matches the exact path' do
67+ match = router . match ( 'GET' , '/api/42/tickets/extra' )
68+ expect ( match . request_definition . path ) . to eq ( '/api/{tenant_id}/tickets/extra' )
69+ end
70+ end
71+
4472 context 'with matching content_type' do
4573 subject ( :router ) do
4674 described_class . new . tap do |router |
You can’t perform that action at this time.
0 commit comments