X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=trunk%2Ft%2Faggregate%2Flive_component_controller_action_local.t;fp=trunk%2Ft%2Faggregate%2Flive_component_controller_action_local.t;h=0000000000000000000000000000000000000000;hb=2757db2c7c600c8a0b8e2b4366f38c97804c2844;hp=24fc2e4eee52e50d8083181d0d11d2324d7a873a;hpb=ceae39c522c2145a453188867dd581062795ecee;p=catagits%2FCatalyst-Runtime.git diff --git a/trunk/t/aggregate/live_component_controller_action_local.t b/trunk/t/aggregate/live_component_controller_action_local.t deleted file mode 100644 index 24fc2e4..0000000 --- a/trunk/t/aggregate/live_component_controller_action_local.t +++ /dev/null @@ -1,145 +0,0 @@ -#!perl - -use strict; -use warnings; - -use FindBin; -use lib "$FindBin::Bin/../lib"; - -our $iters; - -BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } - -use Test::More tests => 34*$iters; -use Catalyst::Test 'TestApp'; - -if ( $ENV{CAT_BENCHMARK} ) { - require Benchmark; - Benchmark::timethis( $iters, \&run_tests ); -} -else { - for ( 1 .. $iters ) { - run_tests(); - } -} - -sub run_tests { - { - ok( my $response = request('http://localhost/action/local/one'), - '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/one', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Local', - 'Test Class' - ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); - } - - { - 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' ); - is( $response->header('X-Catalyst-Action'), - 'action/local/two', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Local', - 'Test Class' - ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); - } - - { - 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' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), - 'action/local/three', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Local', - 'Test Class' - ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); - } - - { - ok( - my $response = - request('http://localhost/action/local/four/five/six'), - '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/four/five/six', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Local', - 'Test Class' - ); - like( - $response->content, - qr/^bless\( .* 'Catalyst::Request' \)$/s, - 'Content is a serialized Catalyst::Request' - ); - } - - SKIP: - { - if ( $ENV{CATALYST_SERVER} ) { - skip "tests for %2F on remote server", 6; - } - - ok( - my $response = - 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/one', 'Test Action' ); - is( - $response->header('X-Test-Class'), - 'TestApp::Controller::Action::Local', - 'Test Class' - ); - like( - $response->content, - qr~arguments => \[\s*'foo/bar'\s*\]~, - "Parameters don't split on %2F" - ); - } - - { - ok( my $content = get('http://locahost/action/local/five/foo%2Fbar%3B'), - 'request with URI-encoded arg'); - # this is the CURRENT behavior - like( $content, qr{'foo/bar;'}, 'args for Local actions URI-decoded' ); - } -}