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';
21 #warn ref($c)->dispatcher->get_action('story/story', '/root');
24 #Dwarn ref($c)->dispatcher->_action_hash->{'story/story'};
27 MyApp::Controller::Root->config(namespace=>'');
29 package MyApp::Controller::Story;
30 $INC{'MyApp/Controller/Story.pm'} = __FILE__;
33 use MooseX::MethodAttributes;
35 extends 'Catalyst::Controller';
37 sub root :Chained(/root) PathPart('') CaptureArgs(0) {
41 sub story :Chained(root) Args(0) {
44 Test::Most::is $self->action_for('story'), 'story/story';
45 Test::Most::is $self->action_for('author/author'), 'story/author/author';
48 __PACKAGE__->meta->make_immutable;
50 package MyApp::Controller::Story::Author;
51 $INC{'MyApp/Controller/Story/Author.pm'} = __FILE__;
54 use MooseX::MethodAttributes;
56 extends 'Catalyst::Controller';
58 sub root :Chained(/story/root) PathPart('') CaptureArgs(0) {
62 sub author :Chained(root) Args(0) {
63 my ($self, $c, $id) = @_;
64 Test::Most::is $self->action_for('author'), 'story/author/author';
68 __PACKAGE__->meta->make_immutable;
71 $INC{'MyApp.pm'} = __FILE__;
78 use Catalyst::Test 'MyApp';