X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_chained.t;h=f0cbc6a74c16edecd69c8a55341c2465e52c8ced;hb=6ca3b7de88bc467ca828496a614d84dc3a9a2b51;hp=d6fcfedcc7eaf489e089e9faeca0ccb3c6ecae44;hpb=d527814de606d136a35990e042cb1e23e54a73dd;p=catagits%2FCatalyst-Runtime.git diff --git a/t/aggregate/live_component_controller_action_chained.t b/t/aggregate/live_component_controller_action_chained.t index d6fcfed..f0cbc6a 100644 --- a/t/aggregate/live_component_controller_action_chained.t +++ b/t/aggregate/live_component_controller_action_chained.t @@ -1,5 +1,3 @@ -#!perl - use strict; use warnings; @@ -773,6 +771,44 @@ sub run_tests { } # + # Test throwing an error in the middle of a chain. + # + { + my @expected = qw[ + TestApp::Controller::Action::Chained->begin + TestApp::Controller::Action::Chained->chain_error_a + TestApp::Controller::Action::Chained->end + ]; + + my $expected = join( ", ", @expected ); + + ok( my $response = request('http://localhost/chained/chain_error/1/end/2'), + "Break a chain in the middle" ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + is( $response->content, 'FATAL ERROR: break in the middle of a chain', 'Content OK' ); + } + + # + # Test dieing in the middle of a chain. + # + { + my @expected = qw[ + TestApp::Controller::Action::Chained->begin + TestApp::Controller::Action::Chained->chain_die_a + TestApp::Controller::Action::Chained->end + ]; + + my $expected = join( ", ", @expected ); + + ok( my $response = request('http://localhost/chained/chain_die/1/end/2'), + "Break a chain in the middle" ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + is( $response->content, 'FATAL ERROR: Caught exception in TestApp::Controller::Action::Chained->chain_die_a "die in the middle of a chain"', 'Content OK' ); + } + + # # Tests that an uri_for to a chained root index action # returns the right value. #