BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 141*$iters;
+use Test::More tests => 143*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
is( $response->header('X-Catalyst-Executed'),
$expected, 'Executed actions' );
}
+
+ #
+ # */search
+ # doc/*
+ #
+ # request for doc/search should end up in doc/*
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Chained->begin
+ TestApp::Controller::Action::Chained->doc_star
+ TestApp::Controller::Action::Chained->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/chained/doc/search'),
+ "we prefer static path parts earlier in the chain" );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ }
}
sub static_end : Chained('korv') Args(0) { }
sub capture_end : Chained('wurst') Args(0) PathPart('') { }
+
+# */search vs doc/*
+sub view : Chained('/') PathPart('chained') CaptureArgs(1) {}
+sub star_search : Chained('view') PathPart('search') Args(0) { }
+sub doc_star : Chained('/') PathPart('chained/doc') Args(1) {}
+
sub end :Private {
my ($self, $c) = @_;
return if $c->stash->{no_end};