# This file documents the revision history for Perl extension Catalyst.
+ - Fix forwarding to Catalyst::Action objects (Rafael Kitover).
- Fix links to the mailing lists (Florian Ragwitz).
- Use Class::MOP instead of Class::Inspector (Florian Ragwitz).
- Change Catalyst::Test to use Sub::Exporter (Florian Ragwitz).
bricas: Brian Cassidy <bricas@cpan.org>
+Caelum: Rafael Kitover <rkitover@io.com>
+
chansen: Christian Hansen
chicks: Christopher Hicks
my $action;
# go to a string path ("/foo/bar/gorch")
- # or action object which stringifies to that
- $action = $self->_invoke_as_path( $c, "$command", \@args );
+ # or action object
+ if (Scalar::Util::blessed($command) && $command->isa('Catalyst::Action')) {
+ $action = $command;
+ }
+ else {
+ $action = $self->_invoke_as_path( $c, "$command", \@args );
+ }
# go to a component ( "MyApp::*::Foo" or $c->component("...")
# - a path or an object)
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} ) {
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');
+ }
}
$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';