X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_action_path.t;h=18fc83d6b0fcc30261ff5ed31772bbd9a93bb79c;hb=f2e13bbd72d59b71fe8916aa802d2631217bd51d;hp=24aeffe403996a5c15e618f9295f700a899fcef1;hpb=50cc3183118f1056427ab314b84b91fd0d9e1383;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_action_path.t b/t/live_component_controller_action_path.t index 24aeffe..18fc83d 100644 --- a/t/live_component_controller_action_path.t +++ b/t/live_component_controller_action_path.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} || 2; } +BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } -use Test::More tests => 30*$iters; +use Test::More tests => 36*$iters; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -27,14 +27,14 @@ sub run_tests { { ok( my $response = - request('http://localhost/action/path/a path with spaces'), + request('http://localhost/action/path/a%20path%20with%20spaces'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/plain', 'Response Content-Type' ); is( $response->header('X-Catalyst-Action'), - 'action/path/a path with spaces', + 'action/path/a%20path%20with%20spaces', 'Test Action' ); is( @@ -55,7 +55,7 @@ sub run_tests { ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/plain', 'Response Content-Type' ); is( $response->header('X-Catalyst-Action'), - 'action/path/åäö', 'Test Action' ); + 'action/path/%C3%A5%C3%A4%C3%B6', 'Test Action' ); is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Path', @@ -124,4 +124,22 @@ sub run_tests { 'Content is a serialized Catalyst::Request' ); } + + { + ok( my $response = request('http://localhost/0'), 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + '0', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Root', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } }