even this change is appreciated.
[catagits/Catalyst-Runtime.git] / t / relative_root_action_for_bug.t
index 9443052..06cd0c2 100644 (file)
@@ -1,4 +1,6 @@
-use Test::Most;
+use warnings;
+use strict;
+use Test::More;
 
 {
     package MyApp::Controller::Root;
@@ -15,13 +17,14 @@ use Test::Most;
 
     sub top :Chained('root') Args(0) {
       my ($self, $c) = @_;
-      Test::Most::is $self->action_for('top'), 'top';
-      Test::Most::is $self->action_for('story/story'), 'story/story';
+      Test::More::is $self->action_for('top'), 'top';
+      Test::More::is $self->action_for('story/story'), 'story/story';
+    }
 
-      #warn ref($c)->dispatcher->get_action('story/story', '/root');
+    sub default : Path {
 
-      #use Devel::Dwarn;
-      #Dwarn ref($c)->dispatcher->_action_hash->{'story/story'};
+        my ($self, $c) = @_;
+        $c->response->body("Ok");
     }
 
     MyApp::Controller::Root->config(namespace=>'');
@@ -41,8 +44,8 @@ use Test::Most;
     sub story :Chained(root) Args(0) {
       my ($self, $c) = @_;
 
-      Test::Most::is $self->action_for('story'), 'story/story';
-      Test::Most::is $self->action_for('author/author'), 'story/author/author';
+      Test::More::is $self->action_for('story'), 'story/story';
+      Test::More::is $self->action_for('author/author'), 'story/author/author';
     }
 
     __PACKAGE__->meta->make_immutable;
@@ -61,10 +64,11 @@ use Test::Most;
 
     sub author :Chained(root) Args(0) {
       my ($self, $c, $id) = @_;
-      Test::Most::is $self->action_for('author'), 'story/author/author';
+      Test::More::is $self->action_for('author'), 'story/author/author';
+      Test::More::is $self->action_for('../story'), 'story/story';
+      Test::More::is $self->action_for('../../top'), 'top';
     }
 
-
     __PACKAGE__->meta->make_immutable;
 
     package MyApp;
@@ -77,9 +81,13 @@ use Test::Most;
 
 use Catalyst::Test 'MyApp';
 
+ok request '/top';
 ok request '/story';
 ok request '/author';
-ok request '/top';
+ok request '/double';
+ok request '/double/file.ext';
+ok request '/double/file..ext';
+
 
-done_testing(8);
+done_testing(13);