X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_args.t;h=f5768ae6d328ff95985c943d72acaa8bf4c70e8d;hb=12cd259ddc8814c8a8e2ced2599abdc5aef22683;hp=9bdd7d96e71d9da4d374e7af4e6ab95170818b02;hpb=855ed93153e2b0c0e88d9bb8f23822c914393048;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_args.t b/t/live_component_controller_args.t index 9bdd7d9..f5768ae 100644 --- a/t/live_component_controller_args.t +++ b/t/live_component_controller_args.t @@ -11,7 +11,7 @@ use URI::Escape; our @paths; our $iters; -BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; +BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; # add special paths to test here @paths = ( @@ -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} ) { @@ -62,17 +62,36 @@ sub run_test_for { } else { $path = uri_escape($test); } + + SKIP: + { + # Skip %2F and . tests on real webservers, they are often ignored by default + if ( $ENV{CATALYST_SERVER} && $path =~ /(?:%2F|\.)/ ) { + skip "Skipping $path tests on remote server", 6; + } - my $response; + my $response; - ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path"); + ok( $response = request("http://localhost/args/args/$path"), "Requested args for path $path"); - is( $response->content, $test, 'as args' ); + is( $response->content, $test, "$test as args" ); - undef $response; + undef $response; - ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path"); + ok( $response = request("http://localhost/args/params/$path"), "Requested params for path $path"); - is( $response->content, $test, 'as params' ); + is( $response->content, $test, "$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 ) ) ."; ", "$test as capture" ); + } }