X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fglobal.t;h=44aad6dc0fbfd9fcad64ddcf1deef2661a0bf9ad;hp=b1bb53a452bdb7766be6e697ed38ca7f8da56f37;hb=d8c66af52b5353c93b1816e19c0f1cac69bc5ad1;hpb=b14151e76ebbd0a776e7955238ce1afbc1985a33 diff --git a/t/live/component/controller/action/global.t b/t/live/component/controller/action/global.t index b1bb53a..44aad6d 100644 --- a/t/live/component/controller/action/global.t +++ b/t/live/component/controller/action/global.t @@ -6,33 +6,64 @@ use warnings; use FindBin; use lib "$FindBin::Bin/../../../lib"; -use Test::More tests => 18; +use Test::More tests => 180; use Catalyst::Test 'TestApp'; +for ( 1 .. 10 ) { + { + ok( my $response = request('http://localhost/action_global_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_global_one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action_global_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_global_one', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} - -{ - ok( my $response = request('http://localhost/action_global_two'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action_global_two', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); -} + { + ok( my $response = request('http://localhost/action_global_two'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action_global_two', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } -{ - ok( my $response = request('http://localhost/action_global_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_global_three', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Global', 'Test Class' ); - like( $response->content, qr/^bless\( .* 'Catalyst::Request' \)$/s, 'Content is a serialized Catalyst::Request' ); + { + ok( my $response = request('http://localhost/action_global_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_global_three', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Global', + 'Test Class' + ); + like( + $response->content, + qr/^bless\( .* 'Catalyst::Request' \)$/s, + 'Content is a serialized Catalyst::Request' + ); + } }