Create branch register_actions.
[catagits/Catalyst-Runtime.git] / t / aggregate / live_component_controller_action_chained.t
@@ -4,13 +4,13 @@ use strict;
 use warnings;
 
 use FindBin;
-use lib "$FindBin::Bin/lib";
+use lib "$FindBin::Bin/../lib";
 
 our $iters;
 
 BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
 
-use Test::More tests => 141*$iters;
+use Test::More tests => 143*$iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -981,4 +981,27 @@ sub run_tests {
         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' );
+        }
+    }
 }