[Catalyst-commits] r8161 - in Catalyst-Runtime/5.70/trunk/t: .
lib/TestApp/Controller/Action
marcus at dev.catalyst.perl.org
marcus at dev.catalyst.perl.org
Fri Jul 25 07:56:33 BST 2008
Author: marcus
Date: 2008-07-25 07:56:31 +0100 (Fri, 25 Jul 2008)
New Revision: 8161
Modified:
Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Go.pm
Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_go.t
Log:
Add chained go tests
Modified: Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Go.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Go.pm 2008-07-23 18:18:31 UTC (rev 8160)
+++ Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Go.pm 2008-07-25 06:56:31 UTC (rev 8161)
@@ -61,6 +61,11 @@
die $Catalyst::GO;
}
+sub go_chained : Local {
+ my ( $self, $c, $val ) = @_;
+ $c->go('/action/chained/foo/spoon',[1]);
+}
+
sub args_embed_relative : Local {
my ( $self, $c ) = @_;
$c->go('embed/ok');
Modified: Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_go.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_go.t 2008-07-23 18:18:31 UTC (rev 8160)
+++ Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_go.t 2008-07-25 06:56:31 UTC (rev 8161)
@@ -10,7 +10,7 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 47 * $iters;
+use Test::More tests => 50 * $iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
@@ -223,8 +223,28 @@
'Test Method' );
}
+ {
+ my @expected = qw[
+ TestApp::Controller::Action::Go->begin
+ TestApp::Controller::Action::Go->go_chained
+ TestApp::Controller::Action::Chained->begin
+ TestApp::Controller::Action::Chained->foo
+ TestApp::Controller::Action::Chained::Foo->spoon
+ TestApp::Controller::Action::Chained->end
+ ];
+
+ my $expected = join( ", ", @expected );
+
+ ok( my $response = request('http://localhost/action/go/go_chained'), 'go to chained + subcontroller endpoint' );
+ is( $response->header('X-Catalyst-Executed'),
+ $expected, 'Executed actions' );
+ is( $response->content, '; 1', 'Content OK' );
+ }
+
}
+
+
sub _begin {
local $_ = shift;
s/->(.*)$/->begin/;
More information about the Catalyst-commits
mailing list