BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 141*$iters;
+use Test::More tests => 148*$iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
my @expected = qw[
TestApp::Controller::Action::Chained::Root->rootsub
TestApp::Controller::Action::Chained::Root->endpointsub
- TestApp->end
+ TestApp::Controller::Root->end
];
my $expected = join( ", ", @expected );
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" );
+ TODO: {
+ local $TODO = 'gbjk never got off his ass and fixed this';
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ }
+ }
+
+ {
+ ok( my $content =
+ get('http://localhost/chained/capture%2Farg%3B/return_arg/foo%2Fbar%3B'),
+ 'request with URI-encoded arg' );
+ like( $content, qr{foo/bar;\z}, 'args decoded' );
+ like( $content, qr{capture/arg;}, 'captureargs decoded' );
+ }
+ {
+ ok( my $content =
+ get('http://localhost/chained/return_arg_decoded/foo%2Fbar%3B'),
+ 'request with URI-encoded arg' );
+ like( $content, qr{foo/bar;\z}, 'args decoded' );
+ }
}
+