4 use HTTP::Request::Common;
7 package MyApp::Controller::Root;
8 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
10 use base 'Catalyst::Controller';
12 MyApp::Controller::Root->config(namespace=>'');
16 Test::More::is($c->state, 0);
22 # Even if a begin returns something, we kill it. Need to
23 # do this since there's actually people doing detach in
24 # auto and expect that to work the same as 0.
25 Test::More::is($c->state, '0');
30 sub base :Chained('/') PathPrefix CaptureArgs(0) {
32 Test::More::is($c->state, 'auto');
36 sub one :Chained('base') PathPart('') CaptureArgs(0) {
38 Test::More::is($c->state, 10);
42 sub two :Chained('one') PathPart('') Args(1) {
43 my ($self, $c, $arg) = @_;
44 Test::More::is($c->state, 20);
45 my $ret = $c->forward('forward2');
46 Test::More::is($ret, 25);
47 Test::More::is($c->state, 25);
53 Test::More::is($c->state, 30);
54 my $ret = $c->forward('forward1');
55 Test::More::is($ret, 100);
56 Test::More::is($c->state, 100);
57 $c->detach('detach1');
60 sub forward1 :Action {
62 Test::More::is($c->state, 30);
66 sub forward2 :Action {
68 Test::More::is($c->state, 20);
74 Test::More::is($c->state, 100);
80 MyApp->config(show_internal_actions=>1);
84 use Catalyst::Test 'MyApp';
87 ok my $res = request "/100";