X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flive_component_controller_action_chained.t;h=e9033919884e93f494990f9a429fe6e982d96e3a;hb=6395438e94034711cd5cb5f7646f868f045b1776;hp=ee502146cd32ed4cbc4edcc65b42c7f0daec269e;hpb=8a6a6581d48a3c1c4d5f631cdb7cbda336c0e5e2;p=catagits%2FCatalyst-Runtime.git diff --git a/t/live_component_controller_action_chained.t b/t/live_component_controller_action_chained.t index ee50214..e903391 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 => 101*$iters; +use Test::More tests => 106*$iters; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -691,13 +691,29 @@ sub run_tests { } # + # Tests that an uri_for to a chained root index action + # returns the right value. + # + { + ok( my $response = request( + 'http://localhost/action/chained/to_root' ), + 'uri_for with chained root action as arg' ); + is( $response->content, + 'URI:http://localhost/', + 'Correct URI generated' ); + } + + # # Test interception of recursive chains. This test was added because at # one point during the :Chained development, Catalyst used to hang on # recursive chains. # { eval { require 'TestAppChainedRecursive.pm' }; - pass( "Interception of recursive chains" ); + if ($run_number == 1) { + ok( ! $@, "Interception of recursive chains" ); + } + else { pass( "Interception of recursive chains already tested" ) } } # @@ -711,4 +727,25 @@ sub run_tests { } else { pass( "Error on absolute path part arguments already tested" ) } } + + # + # Complex path with multiple empty pathparts + # + { + my @expected = qw[ + TestApp::Controller::Action::Chained->begin + TestApp::Controller::Action::Chained->mult_nopp_base + TestApp::Controller::Action::Chained->mult_nopp_all + TestApp::Controller::Action::Chained->end + ]; + + my $expected = join( ", ", @expected ); + + ok( my $response = request('http://localhost/chained/mult_nopp'), + "Complex path with multiple empty pathparts" ); + is( $response->header('X-Catalyst-Executed'), + $expected, 'Executed actions' ); + is( $response->content, '; ', 'Content OK' ); + } + }