[Catalyst-commits] r9077 - in Catalyst-Runtime/5.70/trunk: . t
t/lib/TestApp/Controller/Action
marcus at dev.catalyst.perl.org
marcus at dev.catalyst.perl.org
Mon Jan 12 15:14:39 GMT 2009
Author: marcus
Date: 2009-01-12 15:14:38 +0000 (Mon, 12 Jan 2009)
New Revision: 9077
Modified:
Catalyst-Runtime/5.70/trunk/Changes
Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Forward.pm
Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_forward.t
Log:
Add tests for forwarding to action object
Modified: Catalyst-Runtime/5.70/trunk/Changes
===================================================================
--- Catalyst-Runtime/5.70/trunk/Changes 2009-01-12 15:04:57 UTC (rev 9076)
+++ Catalyst-Runtime/5.70/trunk/Changes 2009-01-12 15:14:38 UTC (rev 9077)
@@ -6,10 +6,11 @@
- Change streaming test to serve itself rather than 01use.t, making test
sync for engines easier (t0m)
- Workaround change in LWP that broke a cookie test (RT #40037)
- - Back out go() since that feature's been pushed to 5.80
+ - Backport go() from 5.8 branch.
- Fix some Win32 test failures
- Add pt translation of error message (wreis)
- Make :Chained('../action') work (Florian Ragwitz)
+ - Fix forwarding to action object.
- Handle leading CRLF in HTTP requests sometimes sent by IE6 in keep-alive requests.
5.7099_03 2008-07-20 10:10:00
Modified: Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Forward.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Forward.pm 2009-01-12 15:04:57 UTC (rev 9076)
+++ Catalyst-Runtime/5.70/trunk/t/lib/TestApp/Controller/Action/Forward.pm 2009-01-12 15:14:38 UTC (rev 9077)
@@ -56,7 +56,13 @@
$c->forward( qw/TestApp::Controller::Action::Forward args/, [qq/new/] );
$c->res->body( $c->req->args->[0] );
}
+
+sub to_action_object : Local {
+ my ( $self, $c ) = @_;
+ $c->forward($self->action_for('embed'), [qw/mtfnpy/]);
+}
+
sub args : Local {
my ( $self, $c, $val ) = @_;
die "Expected argument 'new', got '$val'" unless $val eq 'new';
Modified: Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_forward.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_forward.t 2009-01-12 15:04:57 UTC (rev 9076)
+++ Catalyst-Runtime/5.70/trunk/t/live_component_controller_action_forward.t 2009-01-12 15:14:38 UTC (rev 9077)
@@ -10,7 +10,7 @@
BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; }
-use Test::More tests => 50 * $iters;
+use Test::More tests => 53 * $iters;
use Catalyst::Test 'TestApp';
if ( $ENV{CAT_BENCHMARK} ) {
@@ -245,4 +245,15 @@
is( $response->content, '/action/forward/foo/bar',
'forward_to_uri_check correct namespace');
}
+
+ # test forwarding to Catalyst::Action objects
+ {
+ ok( my $response = request(
+ 'http://localhost/action/forward/to_action_object'),
+ 'forward/to_action_object request');
+
+ ok( $response->is_success, 'forward/to_action_object successful');
+ is( $response->content, 'mtfnpy',
+ 'forward/to_action_object forwards correctly');
+ }
}
More information about the Catalyst-commits
mailing list