File tree Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Expand file tree Collapse file tree 1 file changed +31
-0
lines changed Original file line number Diff line number Diff line change @@ -480,6 +480,37 @@ def subject.enable_root_route!
480
480
end
481
481
end
482
482
483
+ it 'allows for catch-all in a namespace' do
484
+ subject . namespace :nested do
485
+ get do
486
+ 'root'
487
+ end
488
+
489
+ get 'something' do
490
+ 'something'
491
+ end
492
+
493
+ route :any , '*path' do
494
+ 'catch-all'
495
+ end
496
+ end
497
+
498
+ send ( 'get' , 'nested' )
499
+ expect ( last_response . body ) . to eql 'root'
500
+
501
+ send ( 'get' , 'nested/something' )
502
+ expect ( last_response . body ) . to eql 'something'
503
+
504
+ send ( 'get' , 'nested/missing' )
505
+ expect ( last_response . body ) . to eql 'catch-all'
506
+
507
+ send ( 'post' , 'nested' )
508
+ expect ( last_response . body ) . to eql 'catch-all'
509
+
510
+ send ( 'post' , 'nested/something' )
511
+ expect ( last_response . body ) . to eql 'catch-all'
512
+ end
513
+
483
514
verbs = %w( post get head delete put options patch )
484
515
verbs . each do |verb |
485
516
it 'allows and properly constrain a #{verb.upcase} method' do
You can’t perform that action at this time.
0 commit comments