X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fdetach.t;fp=t%2Flive%2Fcomponent%2Fcontroller%2Faction%2Fdetach.t;h=7ea99b499d561f84ff00de04387a2ed6c3244dd7;hb=d8c66af52b5353c93b1816e19c0f1cac69bc5ad1;hp=f33ee7a2bf3a20de586410702dd77fd68ba4138a;hpb=b14151e76ebbd0a776e7955238ce1afbc1985a33;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live/component/controller/action/detach.t b/t/live/component/controller/action/detach.t index f33ee7a..7ea99b4 100644 --- a/t/live/component/controller/action/detach.t +++ b/t/live/component/controller/action/detach.t @@ -6,56 +6,79 @@ 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 ) { + { + my @expected = qw[ + TestApp::Controller::Action::Detach->begin + TestApp::Controller::Action::Detach->one + TestApp::Controller::Action::Detach->two + TestApp::View::Dump::Request->process + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::Detach->begin - TestApp::Controller::Action::Detach->one - TestApp::Controller::Action::Detach->two - TestApp::View::Dump::Request->process - ]; + my $expected = join( ", ", @expected ); - my $expected = join( ", ", @expected ); + # Test detach to chain of actions. + ok( my $response = request('http://localhost/action/detach/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/detach/one', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Detach', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + } - # Test detach to chain of actions. - ok( my $response = request('http://localhost/action/detach/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/detach/one', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); -} + { + my @expected = qw[ + TestApp::Controller::Action::Detach->begin + TestApp::Controller::Action::Detach->path + TestApp::Controller::Action::Detach->two + TestApp::View::Dump::Request->process + ]; -{ - my @expected = qw[ - TestApp::Controller::Action::Detach->begin - TestApp::Controller::Action::Detach->path - TestApp::Controller::Action::Detach->two - TestApp::View::Dump::Request->process - ]; - - my $expected = join( ", ", @expected ); - - # Test detach to chain of actions. - ok( my $response = request('http://localhost/action/detach/path'), 'Request' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content_type, 'text/plain', 'Response Content-Type' ); - is( $response->header('X-Catalyst-Action'), 'action/detach/path', 'Test Action' ); - is( $response->header('X-Test-Class'), 'TestApp::Controller::Action::Detach', 'Test Class' ); - is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); -} + my $expected = join( ", ", @expected ); -{ - ok( my $response = request('http://localhost/action/detach/with_args/old'), 'Request with args' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'new'); -} + # Test detach to chain of actions. + ok( my $response = request('http://localhost/action/detach/path'), + 'Request' ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content_type, 'text/plain', 'Response Content-Type' ); + is( $response->header('X-Catalyst-Action'), + 'action/detach/path', 'Test Action' ); + is( + $response->header('X-Test-Class'), + 'TestApp::Controller::Action::Detach', + 'Test Class' + ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + } + + { + ok( + my $response = + request('http://localhost/action/detach/with_args/old'), + 'Request with args' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'new' ); + } -{ - ok( my $response = request('http://localhost/action/detach/with_method_and_args/old'), 'Request with args and method' ); - ok( $response->is_success, 'Response Successful 2xx' ); - is( $response->content, 'new'); + { + ok( + my $response = request( + 'http://localhost/action/detach/with_method_and_args/old'), + 'Request with args and method' + ); + ok( $response->is_success, 'Response Successful 2xx' ); + is( $response->content, 'new' ); + } }