X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_action_local.t;h=3670bd944a9f55ac47288615d4011f5b46140a26;hb=8c25d85b1c79a9671c0e81e65c5ff5c112e8399f;hp=70a31e76a51c7df0f75fb9ae029214978aeb9fa5;hpb=595f3872331fe9d3b2fc22a18a7e03abc1e69d42;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_action_local.t b/t/live_component_controller_action_local.t index 70a31e7..3670bd9 100644 --- a/t/live_component_controller_action_local.t +++ b/t/live_component_controller_action_local.t @@ -8,9 +8,9 @@ use lib "$FindBin::Bin/lib"; our $iters; -BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; } +BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } -use Test::More tests => 30*$iters; +use Test::More tests => 32*$iters; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -44,7 +44,7 @@ sub run_tests { } { - ok( my $response = request('http://localhost/action/local/two'), + ok( my $response = request('http://localhost/action/local/two/1/2'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/plain', 'Response Content-Type' ); @@ -63,6 +63,12 @@ sub run_tests { } { + ok( my $response = request('http://localhost/action/local/two'), + 'Request' ); + ok( !$response->is_success, 'Request with wrong number of args failed' ); + } + + { ok( my $response = request('http://localhost/action/local/three'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); @@ -103,16 +109,21 @@ sub run_tests { ); } - { + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip "tests for %2F on remote server", 6; + } + ok( my $response = - request('http://localhost/action/local/two/foo%2Fbar'), + request('http://localhost/action/local/one/foo%2Fbar'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/plain', 'Response Content-Type' ); is( $response->header('X-Catalyst-Action'), - 'action/local/two', 'Test Action' ); + 'action/local/one', 'Test Action' ); is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Local', @@ -120,7 +131,7 @@ sub run_tests { ); like( $response->content, - qr/arguments => \[\s*'foo%2Fbar'\s*\]/, + qr~arguments => \[\s*'foo/bar'\s*\]~, "Parameters don't split on %2F" ); }