added PathPrefix from branch
[catagits/Catalyst-Runtime.git] / t / live_component_controller_action_chained.t
index 619a7ed..9fcdc48 100644 (file)
@@ -8,9 +8,9 @@ use lib "$FindBin::Bin/lib";
 
 our $iters;
 
-BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; }
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 109*$iters;
+use Test::More tests => 112*$iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -733,10 +733,9 @@ sub run_tests {
     #
     {
         my @expected = qw[
-          TestApp::Controller::Action::Chained->begin
           TestApp::Controller::Action::Chained::Root->rootsub
           TestApp::Controller::Action::Chained::Root->endpointsub
-          TestApp::Controller::Action::Chained->end
+          TestApp->end
         ];
 
         my $expected = join( ", ", @expected );
@@ -744,7 +743,7 @@ sub run_tests {
         ok( my $response = request('http://localhost/rootsub/1/endpointsub/2'), 'chained in root namespace' );
         is( $response->header('X-Catalyst-Executed'),
             $expected, 'Executed actions' );
-        is( $response->content, '1; 2', 'Content OK' );
+        is( $response->content, '', 'Content OK' );
     }
 
     #
@@ -767,4 +766,22 @@ sub run_tests {
         is( $response->content, '; ', 'Content OK' );
     }
 
+    #
+    #   PathPrefix
+    #
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained::PathPrefix->instance
+          TestApp::Controller::Action::Chained->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        ok( my $response = request('http://localhost/action/chained/pathprefix/1'),
+            "PathPrefix (as an endpoint)" );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, '; 1', 'Content OK' );
+    }
 }