6 package MyApp::Controller::Root;
7 $INC{'MyApp/Controller/Root.pm'} = __FILE__;
10 use MooseX::MethodAttributes;
12 extends 'Catalyst::Controller';
14 sub root :Chained(/) PathPart('') CaptureArgs(0) {
18 sub top :Chained('root') Args(0) {
20 Test::More::is $self->action_for('top'), 'top';
21 Test::More::is $self->action_for('story/story'), 'story/story';
27 $c->response->body("Ok");
30 MyApp::Controller::Root->config(namespace=>'');
32 package MyApp::Controller::Story;
33 $INC{'MyApp/Controller/Story.pm'} = __FILE__;
36 use MooseX::MethodAttributes;
38 extends 'Catalyst::Controller';
40 sub root :Chained(/root) PathPart('') CaptureArgs(0) {
44 sub story :Chained(root) Args(0) {
47 Test::More::is $self->action_for('story'), 'story/story';
48 Test::More::is $self->action_for('author/author'), 'story/author/author';
51 __PACKAGE__->meta->make_immutable;
53 package MyApp::Controller::Story::Author;
54 $INC{'MyApp/Controller/Story/Author.pm'} = __FILE__;
57 use MooseX::MethodAttributes;
59 extends 'Catalyst::Controller';
61 sub root :Chained(/story/root) PathPart('') CaptureArgs(0) {
65 sub author :Chained(root) Args(0) {
66 my ($self, $c, $id) = @_;
67 Test::More::is $self->action_for('author'), 'story/author/author';
68 Test::More::is $self->action_for('../story'), 'story/story';
69 Test::More::is $self->action_for('../../top'), 'top';
72 __PACKAGE__->meta->make_immutable;
75 $INC{'MyApp.pm'} = __FILE__;
82 use Catalyst::Test 'MyApp';
88 ok request '/double/file.ext';
89 ok request '/double/file..ext';