sub cc_b_link : Chained('cc_b') PathPart('') CaptureArgs(1) { }
sub cc_b_anchor : Chained('cc_b_link') PathPart('anchor.html') Args() { }
+#
+# Test static paths vs. captures
+#
+
+sub apan : Chained('/') CaptureArgs(0) PathPrefix { }
+sub korv : Chained('apan') CaptureArgs(0) PathPart('') { }
+sub wurst : Chained('apan') CaptureArgs(1) PathPart('') { }
+sub static_end : Chained('korv') Args(0) { }
+sub capture_end : Chained('wurst') Args(0) PathPart('') { }
+
sub end :Private {
my ($self, $c) = @_;
return if $c->stash->{no_end};
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 136*$iters;
+use Test::More tests => 138*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
is( $response->content, '; 1', 'Content OK' );
}
+ #
+ # static paths vs. captures
+ #
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Chained->begin
+ TestApp::Controller::Action::Chained->apan
+ TestApp::Controller::Action::Chained->korv
+ TestApp::Controller::Action::Chained->static_end
+ TestApp::Controller::Action::Chained->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/action/chained/static_end'),
+ "static paths are prefered over captures" );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ }
}