X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_chained.t;h=0cebe9bfce1a4fa020a54a33bf02747dff472e91;hb=974733c0febbddd53145ec82031b4ad6abcc0985;hp=b4907f784385390bbe6cfa3c26c3dd7a12d70443;hpb=8c756ee10906d71a264d5ff3d1e6ea7be5cfb58a;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 b4907f7..0cebe9b 100644 --- a/t/aggregate/live_component_controller_action_chained.t +++ b/t/aggregate/live_component_controller_action_chained.t @@ -11,6 +11,8 @@ our $iters; BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } use Test::More; +use URI; +use URI::QueryParam; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -771,6 +773,25 @@ 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_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: break in the middle of a chain', 'Content OK' ); + } + + # # Tests that an uri_for to a chained root index action # returns the right value. # @@ -1115,9 +1136,7 @@ sub run_tests { # where the app is based (live tests etc) is $got->path, $exp->path, "uri $path can round trip through uri_for (path)" or diag("Expected $path, got $content"); - my %got_q = map { split /=/ } split /\&/, ($got->query||''); - my %exp_q = map { split /=/ } split /\&/, ($exp->query||''); - is_deeply \%got_q, \%exp_q, "uri $path can round trip through uri_for (query)" + is_deeply $got->query_form_hash, $exp->query_form_hash, "uri $path can round trip through uri_for (query)" or diag("Expected $path, got $content"); }