test for capture fix, missing svk add
Matt S Trout [Sun, 27 Aug 2006 15:17:48 +0000 (15:17 +0000)]
t/lib/TestApp/Controller/Action/Chained/Root.pm [new file with mode: 0644]
t/live_component_controller_args.t

diff --git a/t/lib/TestApp/Controller/Action/Chained/Root.pm b/t/lib/TestApp/Controller/Action/Chained/Root.pm
new file mode 100644 (file)
index 0000000..a0cc626
--- /dev/null
@@ -0,0 +1,13 @@
+package TestApp::Controller::Action::Chained::Root;
+
+use strict;
+use warnings;
+
+use base qw( Catalyst::Controller );
+
+__PACKAGE__->config->{namespace} = '';
+
+sub rootsub     : PathPart Chained( '/' )       CaptureArgs( 1 ) { }
+sub endpointsub : PathPart Chained( 'rootsub' ) Args( 1 )        { }
+
+1;
index 9bdd7d9..0b869f5 100644 (file)
@@ -30,7 +30,7 @@ BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2;
                 );
 }
 
-use Test::More tests => 4*@paths * $iters;
+use Test::More tests => 6*@paths * $iters;
 use Catalyst::Test 'TestApp';
 
 if ( $ENV{CAT_BENCHMARK} ) {
@@ -74,5 +74,17 @@ sub run_test_for {
     ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path");
 
     is( $response->content, $test, 'as params' );
+
+    undef $response;
+
+    if( $test =~ m{/} ) {
+        $test =~ s{/}{}g;
+        $path = uri_escape( $test ); 
+    }
+
+    ok( $response = request("http://localhost/chained/multi_cap/$path/baz"), "Requested capture for path $path");
+
+    is( $response->content, join( ', ', split( //, $test ) ) ."; ", 'as capture' );
+
 }