[Catalyst-commits] r12151 - in Catalyst-Runtime/5.80/trunk/t: aggregate lib/TestApp/Controller/Action/Chained

gshank at dev.catalyst.perl.org gshank at dev.catalyst.perl.org
Wed Dec 2 21:52:21 GMT 2009


Author: gshank
Date: 2009-12-02 21:52:21 +0000 (Wed, 02 Dec 2009)
New Revision: 12151

Modified:
   Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
   Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
Log:
add another failing test for Chained CaptureArgs preference


Modified: Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t	2009-12-02 19:13:19 UTC (rev 12150)
+++ Catalyst-Runtime/5.80/trunk/t/aggregate/live_component_controller_action_chained.t	2009-12-02 21:52:21 UTC (rev 12151)
@@ -931,6 +931,28 @@
         }
     }
 
+    #  PathPart('...') Args(1) should win over CaptureArgs(2) PathPart('')
+    {
+        my @expected = qw[
+          TestApp::Controller::Action::Chained->begin
+          TestApp::Controller::Action::Chained::CaptureArgs->base
+          TestApp::Controller::Action::Chained::CaptureArgs->test_one_arg
+          TestApp::Controller::Action::Chained::CaptureArgs->end
+        ];
+
+        my $expected = join( ", ", @expected );
+
+        # should dispatch to /base/test_one_arg
+        ok( my $response = request('http://localhost/captureargs/test/one'),
+            'Correct pathpart/arg ran' );
+        TODO: {
+        local $TODO = 'Known bug';
+        is( $response->header('X-Catalyst-Executed'),
+            $expected, 'Executed actions' );
+        is( $response->content, 'base; test_plus_arg; one;', 'Content OK' );
+        }
+    }
+
     #
     #   Args(0) should win over Args() if we actually have no arguments.
     {

Modified: Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm
===================================================================
--- Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm	2009-12-02 19:13:19 UTC (rev 12150)
+++ Catalyst-Runtime/5.80/trunk/t/lib/TestApp/Controller/Action/Chained/CaptureArgs.pm	2009-12-02 21:52:21 UTC (rev 12151)
@@ -5,15 +5,16 @@
 use base qw( Catalyst::Controller );
 
 #
-#   This controller builds two patterns of URI:
+#   This controller build the following patterns of URI:
 #      /captureargs/*/*
 #      /captureargs/*/*/edit
 #      /captureargs/*
 #      /captureargs/*/edit
+#      /captureargs/test/*
 #   It will output the arguments they got passed to @_ after the
 #   context object. 
-#   /captureargs/one/edit should not dispatch to
-#   /captureargs/*/*
+#   /captureargs/one/edit should not dispatch to /captureargs/*/*
+#   /captureargs/test/one should not dispatch to /captureargs/*/*
 
 sub base  :Chained('/') PathPart('captureargs') CaptureArgs(0) {
     my ( $self, $c, $arg ) = @_;
@@ -50,7 +51,12 @@
     push @{ $c->stash->{ passed_args } }, 'view_one_arg';
 }
 
+sub test_plus_arg :Chained('base') PathPart('test') Args(1) {
+    my ( $self, $c, $arg ) = @_;
+    push @{ $c->stash->{ passed_args } }, 'test_plus_arg', $arg;
+}
 
+
 sub end : Private {
     my ( $self, $c ) = @_;
     no warnings 'uninitialized';




More information about the Catalyst-commits mailing list