[Catalyst-commits] r8369 - in Catalyst-Runtime/5.80/branches/context_go: lib t t/lib t/lib/TestApp/Controller/Action t/lib/TestApp/View

batman at dev.catalyst.perl.org batman at dev.catalyst.perl.org
Mon Sep 8 23:58:56 BST 2008


Author: batman
Date: 2008-09-08 23:58:55 +0100 (Mon, 08 Sep 2008)
New Revision: 8369

Added:
   Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Visit.pm
   Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_visit.t
Modified:
   Catalyst-Runtime/5.80/branches/context_go/lib/Catalyst.pm
   Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp.pm
   Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Go.pm
   Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/TestRelative.pm
   Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/View/Dump.pm
   Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_go.t
Log:
Added failing test for go(model|view).
Added test for visit().
Added POD for visit() in Catalyst.pm. (Bailey)
Added names to unnamed go-tests.
Added check if action-class can _DISPATCH in visit().
Changed to use base Catalyst::View in Dumper view:
  Catalyst::Base makes go/visit think they can dispatch View::Dumper.


Modified: Catalyst-Runtime/5.80/branches/context_go/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/lib/Catalyst.pm	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/lib/Catalyst.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -330,13 +330,33 @@
 
 sub detach { my $c = shift; $c->dispatcher->detach( $c, @_ ) }
 
+=head2 $c->visit( $action [, \@arguments ] )
+
+=head2 $c->visit( $class, $method, [, \@arguments ] )
+
+Almost the same as C<forward>, but does a full dispatch, instead of just
+calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
+C<auto> and the method you go to are called, just like a new request.
+
+C<$c-E<gt>stash> is kept unchanged.
+
+In effect, C<visit> allows you to "wrap" another action, just as it
+would have been called by dispatching from a URL, while the analogous
+C<go> allows you to transfer control to another action as if it had
+been reached directly from a URL.
+
+=cut
+
+sub visit { my $c = shift; $c->dispatcher->visit( $c, @_ ) }
+
 =head2 $c->go( $action [, \@arguments ] )
 
 =head2 $c->go( $class, $method, [, \@arguments ] )
 
-Almost the same as C<detach>, but does a full dispatch, instead of just
-calling the new C<$action> / C<$class-E<gt>$method>. This means that C<begin>,
-C<auto> and the method you go to is called, just like a new request.
+Almost the same as C<detach>, but does a full dispatch like C<visit>,
+instead of just calling the new C<$action> /
+C<$class-E<gt>$method>. This means that C<begin>, C<auto> and the
+method you visit are called, just like a new request.
 
 C<$c-E<gt>stash> is kept unchanged.
 

Modified: Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Go.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Go.pm	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Go.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -25,7 +25,7 @@
 
 sub five : Local {
     my ( $self, $c ) = @_;
-    $c->go('View::Dump::Request');
+    $c->forward('View::Dump::Request');
 }
 
 sub inheritance : Local {
@@ -61,6 +61,23 @@
     die $Catalyst::GO;
 }
 
+sub go_chained : Local {
+    my ( $self, $c, $val ) = @_;
+    $c->go('/action/chained/foo/spoon',[1]);
+}
+
+sub view : Local {
+    my ( $self, $c, $val ) = @_;
+    eval { $c->go('View::Dump') };
+    $c->res->body( $@ ? $@ : "go() did not die" );
+}
+
+sub model : Local {
+    my ( $self, $c, $val ) = @_;
+    eval { $c->go('Model::Foo') };
+    $c->res->body( $@ ? $@ : "go() did not die" );
+}
+
 sub args_embed_relative : Local {
     my ( $self, $c ) = @_;
     $c->go('embed/ok');

Modified: Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/TestRelative.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/TestRelative.pm	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/TestRelative.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -26,4 +26,15 @@
     my ( $self, $c ) = @_;
     $c->go( 'TestApp::Controller::Action::Go', 'one' );
 }
+
+sub relative_visit : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('/action/visit/one');
+}
+
+sub relative_visit_two : Local {
+    my ( $self, $c ) = @_;
+    $c->visit( 'TestApp::Controller::Action::Visit', 'one' );
+}
+
 1;

Added: Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Visit.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Visit.pm	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/Controller/Action/Visit.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -0,0 +1,101 @@
+package TestApp::Controller::Action::Visit;
+
+use strict;
+use base 'TestApp::Controller::Action';
+
+sub one : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('two');
+}
+
+sub two : Private {
+    my ( $self, $c ) = @_;
+    $c->visit('three');
+}
+
+sub three : Local {
+    my ( $self, $c ) = @_;
+    $c->visit( $self, 'four' );
+}
+
+sub four : Private {
+    my ( $self, $c ) = @_;
+    $c->visit('/action/visit/five');
+}
+
+sub five : Local {
+    my ( $self, $c ) = @_;
+    $c->forward('View::Dump::Request');
+}
+
+sub inheritance : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('/action/inheritance/a/b/default');
+}
+
+sub global : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('/global_action');
+}
+
+sub with_args : Local {
+    my ( $self, $c, $arg ) = @_;
+    $c->visit( 'args', [$arg] );
+}
+
+sub with_method_and_args : Local {
+    my ( $self, $c, $arg ) = @_;
+    $c->visit( qw/TestApp::Controller::Action::Visit args/, [$arg] );
+}
+
+sub args : Local {
+    my ( $self, $c, $val ) = @_;
+    die "passed argument does not match args" unless $val eq $c->req->args->[0];
+    $c->res->body($val);
+}
+
+sub visit_die : Local {
+    my ( $self, $c, $val ) = @_;
+    eval { $c->visit( 'args', [qq/new/] ) };
+    $c->res->body( $@ ? $@ : "visit() doesn't die" );
+}
+
+sub visit_chained : Local {
+    my ( $self, $c, $val ) = @_;
+    $c->visit('/action/chained/foo/spoon',[1]);
+}
+
+sub view : Local {
+    my ( $self, $c, $val ) = @_;
+    eval { $c->visit('View::Dump') };
+    $c->res->body( $@ ? $@ : "visit() did not die" );
+}
+
+sub model : Local {
+    my ( $self, $c, $val ) = @_;
+    eval { $c->visit('Model::Foo') };
+    $c->res->body( $@ ? $@ : "visit() did not die" );
+}
+
+sub args_embed_relative : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('embed/ok');
+}
+
+sub args_embed_absolute : Local {
+    my ( $self, $c ) = @_;
+    $c->visit('/action/visit/embed/ok');
+}
+
+sub embed : Local {
+    my ( $self, $c, $ok ) = @_;
+    $ok ||= 'not ok';
+    $c->res->body($ok);
+}
+
+sub class_visit_test_action : Local {
+    my ( $self, $c ) = @_;
+    $c->visit(qw/TestApp class_visit_test_method/);
+}
+
+1;

Modified: Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/View/Dump.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/View/Dump.pm	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp/View/Dump.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -1,7 +1,7 @@
 package TestApp::View::Dump;
 
 use strict;
-use base 'Catalyst::Base';
+use base 'Catalyst::View';
 
 use Data::Dumper ();
 use Scalar::Util qw(weaken);

Modified: Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp.pm	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/t/lib/TestApp.pm	2008-09-08 22:58:55 UTC (rev 8369)
@@ -77,6 +77,11 @@
     $c->response->headers->header( 'X-Class-Go-Test-Method' => 1 );
 }
 
+sub class_visit_test_method :Private {
+    my ( $self, $c ) = @_;
+    $c->response->headers->header( 'X-Class-Visit-Test-Method' => 1 );
+}
+
 sub loop_test : Local {
     my ( $self, $c ) = @_;
 

Modified: Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_go.t
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_go.t	2008-09-08 21:05:23 UTC (rev 8368)
+++ Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_go.t	2008-09-08 22:58:55 UTC (rev 8369)
@@ -10,7 +10,7 @@
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 47 * $iters;
+use Test::More tests => 54 * $iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -25,6 +25,16 @@
 
 sub run_tests {
     {
+        # Test go to global private action
+        ok( my $response = request('http://localhost/action/go/global'),
+            'Request' );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is( $response->header('X-Catalyst-Action'),
+            'action/go/global', 'Main Class Action' );
+    }
+
+    {
         my @expected = qw[
           TestApp::Controller::Action::Go->one
           TestApp::Controller::Action::Go->two
@@ -38,16 +48,8 @@
         @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected;
         my $expected = join( ", ", @expected );
 
-        # Test go to global private action
-        ok( my $response = request('http://localhost/action/go/global'),
-            'Request' );
-        ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->content_type, 'text/plain', 'Response Content-Type' );
-        is( $response->header('X-Catalyst-Action'),
-            'action/go/global', 'Main Class Action' );
-
         # Test go to chain of actions.
-        ok( $response = request('http://localhost/action/go/one'),
+        ok( my $response = request('http://localhost/action/go/one'),
             'Request' );
         ok( $response->is_success, 'Response Successful 2xx' );
         is( $response->content_type, 'text/plain', 'Response Content-Type' );
@@ -93,15 +95,32 @@
             $expected, 'Executed actions' );
         is( $response->content, $Catalyst::GO, "Go died as expected" );
     }
-
     {
         ok(
+            my $response = request('http://localhost/action/go/model'),
+            'Request with args'
+        );
+        is( $response->content,
+            q[FATAL ERROR: Couldn't visit command "Model::Foo": ]
+           .q[Action cannot _DISPATCH.], "go('Model::...') test" );
+    }
+    {
+        ok(
+            my $response = request('http://localhost/action/go/view'),
+            'Request with args'
+        );
+        is( $response->content,
+            q[FATAL ERROR: Couldn't visit command "View::Dump": ]
+           .q[Action cannot _DISPATCH.], "go('View::...') test" );
+    }
+    {
+        ok(
             my $response =
               request('http://localhost/action/go/with_args/old'),
             'Request with args'
         );
         ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->content, 'old' );
+        is( $response->content, 'old', 'go() with args (old)' );
     }
 
     {
@@ -111,7 +130,7 @@
             'Request with args and method'
         );
         ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->content, 'new' );
+        is( $response->content, 'new', 'go() with args (new)' );
     }
 
     # test go with embedded args
@@ -122,7 +141,7 @@
             'Request'
         );
         ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->content, 'ok' );
+        is( $response->content, 'ok', 'go() with args_embed_relative' );
     }
 
     {
@@ -132,7 +151,7 @@
             'Request'
         );
         ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->content, 'ok' );
+        is( $response->content, 'ok', 'go() with args_embed_absolute' );
     }
     {
         my @expected = qw[
@@ -211,20 +230,42 @@
         );
     }
 
-    # test class go 
+    # test class go -- MUST FAIL!
     {
         ok(
             my $response = request(
                 'http://localhost/action/go/class_go_test_action'),
             'Request'
         );
-        ok( $response->is_success, 'Response Successful 2xx' );
-        is( $response->header('X-Class-Go-Test-Method'), 1,
-            'Test Method' );
+        ok( !$response->is_success, 'Response Fails' );
+        is( $response->content,
+            q(FATAL ERROR: Couldn't visit command "TestApp": )
+           .q(Invalid action or component.), 'Error message'
+        );
     }
 
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Go->begin
+          TestApp::Controller::Action::Go->go_chained
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained->foo
+          TestApp::Controller::Action::Chained::Foo->spoon
+          TestApp::Controller::Action::Chained->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        ok( my $response = request('http://localhost/action/go/go_chained'), 'go to chained + subcontroller endpoint' );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, '; 1', 'Content OK' );
+    }
+
 }
 
+
+
 sub _begin {
     local $_ = shift;
     s/->(.*)$/->begin/;

Added: Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_visit.t
===================================================================
--- Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_visit.t	                        (rev 0)
+++ Catalyst-Runtime/5.80/branches/context_go/t/live_component_controller_action_visit.t	2008-09-08 22:58:55 UTC (rev 8369)
@@ -0,0 +1,289 @@
+#!perl
+
+use strict;
+use warnings;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+our $iters;
+
+BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
+
+use Test::More tests => 54 * $iters;
+use Catalyst::Test 'TestApp';
+
+if ( $ENV{CAT_BENCHMARK} ) {
+    require Benchmark;
+    Benchmark::timethis( $iters, \&run_tests );
+}
+else {
+    for ( 1 .. $iters ) {
+        run_tests();
+    }
+}
+
+sub run_tests {
+    {
+        # Test visit to global private action
+        ok( my $response = request('http://localhost/action/visit/global'),
+            'Request' );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is( $response->header('X-Catalyst-Action'),
+            'action/visit/global', 'Main Class Action' );
+    }
+
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Visit->one
+          TestApp::Controller::Action::Visit->two
+          TestApp::Controller::Action::Visit->three
+          TestApp::Controller::Action::Visit->four
+          TestApp::Controller::Action::Visit->five
+          TestApp::View::Dump::Request->process
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+        ];
+
+        @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected;
+        my $expected = join( ", ", @expected );
+
+        # Test visit to chain of actions.
+        ok( my $response = request('http://localhost/action/visit/one'),
+            'Request' );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is( $response->header('X-Catalyst-Action'),
+            'action/visit/one', 'Test Action' );
+        is(
+            $response->header('X-Test-Class'),
+            'TestApp::Controller::Action::Visit',
+            'Test Class'
+        );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        like(
+            $response->content,
+            qr/^bless\( .* 'Catalyst::Request' \)$/s,
+            'Content is a serialized Catalyst::Request'
+        );
+    }
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Visit->visit_die
+          TestApp::Controller::Action::Visit->args
+          TestApp->end
+          TestApp->end
+        ];
+
+        @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected;
+        my $expected = join( ", ", @expected );
+
+        ok( my $response = request('http://localhost/action/visit/visit_die'),
+            'Request' );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is( $response->header('X-Catalyst-Action'),
+            'action/visit/visit_die', 'Test Action'
+        );
+        is(
+            $response->header('X-Test-Class'),
+            'TestApp::Controller::Action::Visit',
+            'Test Class'
+        );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, "visit() doesn't die", "Visit does not die" );
+    }
+    {
+        ok(
+            my $response = request('http://localhost/action/visit/model'),
+            'Request with args'
+        );
+        is( $response->content,
+            q[FATAL ERROR: Couldn't visit command "Model::Foo": ]
+           .q[Action cannot _DISPATCH.], "visit('Model::...') test" );
+    }
+    {
+        ok(
+            my $response = request('http://localhost/action/visit/view'),
+            'Request with args'
+        );
+        is( $response->content,
+            q[FATAL ERROR: Couldn't visit command "View::Dump": ]
+           .q[Action cannot _DISPATCH.], "visit('View::...') test" );
+    }
+    {
+        ok(
+            my $response =
+              request('http://localhost/action/visit/with_args/old'),
+            'Request with args'
+        );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content, 'old', 'visit() with args (old)' );
+    }
+
+    {
+        ok(
+            my $response = request(
+                'http://localhost/action/visit/with_method_and_args/new'),
+            'Request with args and method'
+        );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content, 'new', 'visit() with args (new)' );
+    }
+
+    # test visit with embedded args
+    {
+        ok(
+            my $response =
+              request('http://localhost/action/visit/args_embed_relative'),
+            'Request'
+        );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content, 'ok', 'visit() with args_embed_relative' );
+    }
+
+    {
+        ok(
+            my $response =
+              request('http://localhost/action/visit/args_embed_absolute'),
+            'Request'
+        );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content, 'ok', 'visit() with args_embed_absolute' );
+    }
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::TestRelative->relative_visit
+          TestApp::Controller::Action::Visit->one
+          TestApp::Controller::Action::Visit->two
+          TestApp::Controller::Action::Visit->three
+          TestApp::Controller::Action::Visit->four
+          TestApp::Controller::Action::Visit->five
+          TestApp::View::Dump::Request->process
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+        ];
+
+        @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected;
+        my $expected = join( ", ", @expected );
+
+        # Test visit to chain of actions.
+        ok( my $response = request('http://localhost/action/relative/relative_visit'),
+            'Request' );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is( $response->header('X-Catalyst-Action'),
+            'action/relative/relative_visit', 'Test Action' );
+        is(
+            $response->header('X-Test-Class'),
+            'TestApp::Controller::Action::Visit',
+            'Test Class'
+        );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        like(
+            $response->content,
+            qr/^bless\( .* 'Catalyst::Request' \)$/s,
+            'Content is a serialized Catalyst::Request'
+        );
+    }
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::TestRelative->relative_visit_two
+          TestApp::Controller::Action::Visit->one
+          TestApp::Controller::Action::Visit->two
+          TestApp::Controller::Action::Visit->three
+          TestApp::Controller::Action::Visit->four
+          TestApp::Controller::Action::Visit->five
+          TestApp::View::Dump::Request->process
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+          TestApp->end
+        ];
+
+        @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected;
+        my $expected = join( ", ", @expected );
+
+        # Test visit to chain of actions.
+        ok(
+            my $response =
+              request('http://localhost/action/relative/relative_visit_two'),
+            'Request'
+        );
+        ok( $response->is_success, 'Response Successful 2xx' );
+        is( $response->content_type, 'text/plain', 'Response Content-Type' );
+        is(
+            $response->header('X-Catalyst-Action'),
+            'action/relative/relative_visit_two',
+            'Test Action'
+        );
+        is(
+            $response->header('X-Test-Class'),
+            'TestApp::Controller::Action::Visit',
+            'Test Class'
+        );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        like(
+            $response->content,
+            qr/^bless\( .* 'Catalyst::Request' \)$/s,
+            'Content is a serialized Catalyst::Request'
+        );
+    }
+
+    # test class visit -- MUST FAIL!
+    {
+        ok(
+            my $response = request(
+                'http://localhost/action/visit/class_visit_test_action'),
+            'Request'
+        );
+        ok( !$response->is_success, 'Response Fails' );
+        is( $response->content,
+            q(FATAL ERROR: Couldn't visit command "TestApp": )
+           .q(Invalid action or component.), 'Error message'
+        );
+    }
+
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Visit->begin
+          TestApp::Controller::Action::Visit->visit_chained
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained->foo
+          TestApp::Controller::Action::Chained::Foo->spoon
+          TestApp::Controller::Action::Chained->end
+          TestApp->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        ok( my $response = request('http://localhost/action/visit/visit_chained'), 'visit to chained + subcontroller endpoint' );
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, '; 1', 'Content OK' );
+    }
+
+}
+
+
+
+sub _begin {
+    local $_ = shift;
+    s/->(.*)$/->begin/;
+    return $_;
+}
+




More information about the Catalyst-commits mailing list