X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_action_chained.t;h=aba2bee45fd0e21ae7464019af7dfca2dbceec39;hb=cc95842fedcac58b2dc12c6ce547e22d3170351c;hp=e9033919884e93f494990f9a429fe6e982d96e3a;hpb=f505df49a4707ce6962d8a9ebcf5280430a801cf;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_action_chained.t b/t/live_component_controller_action_chained.t index e903391..aba2bee 100644 --- a/t/live_component_controller_action_chained.t +++ b/t/live_component_controller_action_chained.t @@ -10,7 +10,7 @@ our $iters; BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 2; } -use Test::More tests => 106*$iters; +use Test::More tests => 109*$iters; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -57,7 +57,7 @@ sub run_tests { 'chained + local endpoint; missing last argument' ); is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - is( $response->header('Status'), 500, 'Status OK' ); + is( $response->code, 500, 'Status OK' ); } # @@ -235,7 +235,7 @@ sub run_tests { 'multi-action (three args, should lead to error)' ); is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - is( $response->header('Status'), 500, 'Status OK' ); + is( $response->code, 500, 'Status OK' ); } # @@ -646,7 +646,7 @@ sub run_tests { "Loose end is not callable" ); is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' ); - is( $response->header('Status'), 500, 'Status OK' ); + is( $response->code, 500, 'Status OK' ); } # @@ -698,8 +698,8 @@ sub run_tests { ok( my $response = request( 'http://localhost/action/chained/to_root' ), 'uri_for with chained root action as arg' ); - is( $response->content, - 'URI:http://localhost/', + like( $response->content, + qr(URI:http://[^/]+/), 'Correct URI generated' ); } @@ -729,6 +729,24 @@ sub run_tests { } # + # Test chained actions in the root controller + # + { + my @expected = qw[ + TestApp::Controller::Action::Chained::Root->rootsub + TestApp::Controller::Action::Chained::Root->endpointsub + TestApp->end + ]; + + my $expected = join( ", ", @expected ); + + ok( my $response = request('http://localhost/rootsub/1/endpointsub/2'), 'chained in root namespace' ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + is( $response->content, '', 'Content OK' ); + } + + # # Complex path with multiple empty pathparts # {