4 package MyApp::Controller::Root;
5 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
8 use MooseX::MethodAttributes;
10 extends 'Catalyst::Controller';
12 sub root :Chained(/) PathPart('') CaptureArgs(0) {
16 sub top :Chained('root') Args(0) {
18 Test::Most::is $self->action_for('top'), 'top';
19 Test::Most::is $self->action_for('story/story'), 'story/story';
22 MyApp::Controller::Root->config(namespace=>'');
24 package MyApp::Controller::Story;
25 $INC{'MyApp/Controller/Story.pm'} = __FILE__;
28 use MooseX::MethodAttributes;
30 extends 'Catalyst::Controller';
32 sub root :Chained(/root) PathPart('') CaptureArgs(0) {
36 sub story :Chained(root) Args(0) {
39 Test::Most::is $self->action_for('story'), 'story/story';
40 Test::Most::is $self->action_for('author/author'), 'story/author/author';
43 __PACKAGE__->meta->make_immutable;
45 package MyApp::Controller::Story::Author;
46 $INC{'MyApp/Controller/Story/Author.pm'} = __FILE__;
49 use MooseX::MethodAttributes;
51 extends 'Catalyst::Controller';
53 sub root :Chained(/story/root) PathPart('') CaptureArgs(0) {
57 sub author :Chained(root) Args(0) {
58 my ($self, $c, $id) = @_;
59 Test::Most::is $self->action_for('author'), 'story/author/author';
60 Test::Most::is $self->action_for('../story'), 'story/story';
61 Test::Most::is $self->action_for('../../top'), 'top';
64 __PACKAGE__->meta->make_immutable;
67 $INC{'MyApp.pm'} = __FILE__;
74 use Catalyst::Test 'MyApp';