1 # Insane test case for the behavior needed by Plugin::Auhorization::ACL
3 # We have to localise $c->request->{arguments} in
4 # Catalyst::Dispatcher::_do_forward, rather than using save and restore,
5 # as otherwise, the calling $c->detach on an action which says
6 # die $Catalyst:DETACH causes the request arguments to not get restored,
7 # and therefore sub gorch gets the wrong string $frozjob parameter.
9 # Please feel free to break this behavior once a sane hook for safely
10 # executing another action from the dispatcher (i.e. wrapping actions)
11 # is present, so that the Authorization::ACL plugin can be re-written
12 # to not be full of such crazy shit.
22 use base qw/Catalyst Catalyst::Controller/;
27 my ( $class, $action ) = @_;
29 if ( Scalar::Util::blessed($action)
30 and $action->name ne "foobar" ) {
31 eval { $c->detach( 'foobar', [$action, 'foo'] ) };
34 $c->next::method( @_ );
37 sub foobar : Private {
38 die $Catalyst::DETACH;
42 my ( $self, $c, $frozjob ) = @_;
43 is $frozjob, 'wozzle';
44 $c->res->body("gorch");
54 use Catalyst::Test 'ACLTestApp';
55 use Test::More tests => 1;
57 request('http://localhost/gorch/wozzle');