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 @@ -508,6 +508,37 @@ class DummyFormatClass
508
508
end
509
509
end
510
510
511
+ it 'allows for catch-all in a namespace' do
512
+ subject . namespace :nested do
513
+ get do
514
+ 'root'
515
+ end
516
+
517
+ get 'something' do
518
+ 'something'
519
+ end
520
+
521
+ route :any , '*path' do
522
+ 'catch-all'
523
+ end
524
+ end
525
+
526
+ send ( 'get' , 'nested' )
527
+ expect ( last_response . body ) . to eql 'root'
528
+
529
+ send ( 'get' , 'nested/something' )
530
+ expect ( last_response . body ) . to eql 'something'
531
+
532
+ send ( 'get' , 'nested/missing' )
533
+ expect ( last_response . body ) . to eql 'catch-all'
534
+
535
+ send ( 'post' , 'nested' )
536
+ expect ( last_response . body ) . to eql 'catch-all'
537
+
538
+ send ( 'post' , 'nested/something' )
539
+ expect ( last_response . body ) . to eql 'catch-all'
540
+ end
541
+
511
542
verbs = %w( post get head delete put options patch )
512
543
verbs . each do |verb |
513
544
it "allows and properly constrain a #{ verb . upcase } method" do
You can’t perform that action at this time.
0 commit comments