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 Test::More::is($c->state, 'begin'); # default state of 1 is new to 9.0102
27 sub base :Chained('/') PathPrefix CaptureArgs(0) {
29 Test::More::is($c->state, 'auto');
33 sub one :Chained('base') PathPart('') CaptureArgs(0) {
35 Test::More::is($c->state, 10);
39 sub two :Chained('one') PathPart('') Args(1) {
40 my ($self, $c, $arg) = @_;
41 Test::More::is($c->state, 20);
42 my $ret = $c->forward('forward2');
43 Test::More::is($ret, 25);
44 Test::More::is($c->state, 25);
50 Test::More::is($c->state, 30);
51 my $ret = $c->forward('forward1');
52 Test::More::is($ret, 100);
53 Test::More::is($c->state, 100);
54 $c->detach('detach1');
57 sub forward1 :Action {
59 Test::More::is($c->state, 30);
63 sub forward2 :Action {
65 Test::More::is($c->state, 20);
71 Test::More::is($c->state, 100);
77 MyApp->config(show_internal_actions=>1);
81 use Catalyst::Test 'MyApp';
84 ok my $res = request "/100";