Moved end() from Catalyst::Plugin::Test::Plugin to TestApp::Controller::Root. Fixed...
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_action_forward.t
index 750c067..3d838b8 100644 (file)
@@ -10,7 +10,7 @@ our $iters;
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 50 * $iters;
+use Test::More tests => 53 * $iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -33,7 +33,7 @@ sub run_tests {
           TestApp::Controller::Action::Forward->four
           TestApp::Controller::Action::Forward->five
           TestApp::View::Dump::Request->process
-          TestApp->end
+          TestApp::Controller::Root->end
         ];
 
         my $expected = join( ", ", @expected );
@@ -81,7 +81,7 @@ sub run_tests {
           TestApp::Controller::Action::Forward->four
           TestApp::Controller::Action::Forward->five
           TestApp::View::Dump::Request->process
-          TestApp->end
+          TestApp::Controller::Root->end
         ];
 
         my $expected = join( ", ", @expected );
@@ -156,7 +156,7 @@ sub run_tests {
           TestApp::Controller::Action::Forward->four
           TestApp::Controller::Action::Forward->five
           TestApp::View::Dump::Request->process
-          TestApp->end
+          TestApp::Controller::Root->end
         ];
 
         my $expected = join( ", ", @expected );
@@ -191,7 +191,7 @@ sub run_tests {
           TestApp::Controller::Action::Forward->four
           TestApp::Controller::Action::Forward->five
           TestApp::View::Dump::Request->process
-          TestApp->end
+          TestApp::Controller::Root->end
         ];
 
         my $expected = join( ", ", @expected );
@@ -245,4 +245,15 @@ sub run_tests {
         is( $response->content, '/action/forward/foo/bar',
              'forward_to_uri_check correct namespace');
     }
+
+    # test forwarding to Catalyst::Action objects
+    {
+        ok( my $response = request(
+            'http://localhost/action/forward/to_action_object'),
+            'forward/to_action_object request');
+
+        ok( $response->is_success, 'forward/to_action_object successful');
+        is( $response->content, 'mtfnpy',
+             'forward/to_action_object forwards correctly');
+    }
 }