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';
25 $c->response->body("Ok");
28 MyApp::Controller::Root->config(namespace=>'');
30 package MyApp::Controller::Story;
31 $INC{'MyApp/Controller/Story.pm'} = __FILE__;
34 use MooseX::MethodAttributes;
36 extends 'Catalyst::Controller';
38 sub root :Chained(/root) PathPart('') CaptureArgs(0) {
42 sub story :Chained(root) Args(0) {
45 Test::Most::is $self->action_for('story'), 'story/story';
46 Test::Most::is $self->action_for('author/author'), 'story/author/author';
49 __PACKAGE__->meta->make_immutable;
51 package MyApp::Controller::Story::Author;
52 $INC{'MyApp/Controller/Story/Author.pm'} = __FILE__;
55 use MooseX::MethodAttributes;
57 extends 'Catalyst::Controller';
59 sub root :Chained(/story/root) PathPart('') CaptureArgs(0) {
63 sub author :Chained(root) Args(0) {
64 my ($self, $c, $id) = @_;
65 Test::Most::is $self->action_for('author'), 'story/author/author';
66 Test::Most::is $self->action_for('../story'), 'story/story';
67 Test::Most::is $self->action_for('../../top'), 'top';
70 __PACKAGE__->meta->make_immutable;
73 $INC{'MyApp.pm'} = __FILE__;
80 use Catalyst::Test 'MyApp';
86 ok request '/double/file.ext';
87 ok request '/double/file..ext';