For foo_XXXX methods being dispatched as proper actions (via ->forward)
if they have action objects
use strict;
use warnings;
-use Test::More tests => 21;
+use Test::More 0.88;
use FindBin;
use lib ( "$FindBin::Bin/lib", "$FindBin::Bin/../lib" );
);
}
+my $res = request(
+ $t->put(
+ url => '/actions/test',
+ data => '',
+ )
+);
+is(
+ $res->header('Using-Action'),
+ 'STATION',
+ "went through action for dispatching to PUT"
+);
+is(
+ $res->header('Using-Sub-Action'),
+ 'MOO',
+ "went through sub action for dispatching to PUT"
+);
+
+done_testing;
--- /dev/null
+package Test::Action::Class::Sub;
+use Moose;
+
+extends 'Test::Action::Class';
+
+before execute => sub {
+ my ($self, $controller, $c, @args) = @_;
+ $c->response->header( 'Using-Sub-Action' => 'MOO' );
+};
+
+no Moose;
+
+1;
$c->res->body('POST');
}
-sub test_PUT :ActionClass('+Test::Action::Class') {
+sub test_PUT :ActionClass('+Test::Action::Class::Sub') {
my ( $self, $c ) = @_;
$c->res->body('PUT');
}