X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Faggregate%2Flive_component_controller_action_visit.t;h=522137204b40f0486aeb80b162f97e5b285fad58;hp=96fe76220b6aa04438b10dd988848b1916afb5c4;hb=10542b5178b2fa036e0658111523ea68a7a04437;hpb=ae29b412955743885e80350085167b54b69672da diff --git a/t/aggregate/live_component_controller_action_visit.t b/t/aggregate/live_component_controller_action_visit.t index 96fe762..5221372 100644 --- a/t/aggregate/live_component_controller_action_visit.t +++ b/t/aggregate/live_component_controller_action_visit.t @@ -1,5 +1,3 @@ -#!perl - use strict; use warnings; @@ -10,7 +8,7 @@ our $iters; BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } -use Test::More tests => 54 * $iters; +use Test::More tests => 60 * $iters; use Catalyst::Test 'TestApp'; if ( $ENV{CAT_BENCHMARK} ) { @@ -42,11 +40,11 @@ sub run_tests { TestApp::Controller::Action::Visit->four TestApp::Controller::Action::Visit->five TestApp::View::Dump::Request->process - TestApp->end - TestApp->end - TestApp->end - TestApp->end - TestApp->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end ]; @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected; @@ -76,8 +74,8 @@ sub run_tests { my @expected = qw[ TestApp::Controller::Action::Visit->visit_die TestApp::Controller::Action::Visit->args - TestApp->end - TestApp->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end ]; @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected; @@ -166,12 +164,12 @@ sub run_tests { TestApp::Controller::Action::Visit->four TestApp::Controller::Action::Visit->five TestApp::View::Dump::Request->process - TestApp->end - TestApp->end - TestApp->end - TestApp->end - TestApp->end - TestApp->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end ]; @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected; @@ -206,12 +204,12 @@ sub run_tests { TestApp::Controller::Action::Visit->four TestApp::Controller::Action::Visit->five TestApp::View::Dump::Request->process - TestApp->end - TestApp->end - TestApp->end - TestApp->end - TestApp->end - TestApp->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end + TestApp::Controller::Root->end ]; @expected = map { /Action/ ? (_begin($_), $_) : ($_) } @expected; @@ -253,7 +251,7 @@ sub run_tests { ); ok( !$response->is_success, 'Response Fails' ); is( $response->content, - q[FATAL ERROR: Couldn't visit("TestApp"): Action has no namespace: cannot visit() to a plain method or component, must be a :Action or some sort.], + q{FATAL ERROR: Couldn't visit("TestApp"): Action has no namespace: cannot visit() to a plain method or component, must be an :Action of some sort.}, "Cannot visit app namespace" ); } @@ -266,15 +264,19 @@ sub run_tests { TestApp::Controller::Action::Chained->foo TestApp::Controller::Action::Chained::Foo->spoon TestApp::Controller::Action::Chained->end - TestApp->end + TestApp::Controller::Root->end ]; my $expected = join( ", ", @expected ); - ok( my $response = request('http://localhost/action/visit/visit_chained'), 'visit to chained + subcontroller endpoint' ); - is( $response->header('X-Catalyst-Executed'), - $expected, 'Executed actions' ); - is( $response->content, '; 1', 'Content OK' ); + for my $i ( 1..3 ) { + ok( my $response = request("http://localhost/action/visit/visit_chained/$i/becomescapture/arg1/arg2"), + "visit to chained + subcontroller endpoint for $i" ); + is( $response->header('X-Catalyst-Executed'), + $expected, "Executed actions for $i" ); + is( $response->content, "becomescapture; arg1, arg2", + "Content OK for $i" ); + } } }