Moved first-level index to a new controller so inheritence doesn't break
Andy Grundman [Sat, 22 Oct 2005 14:18:40 +0000 (14:18 +0000)]
t/live/component/controller/action/index.t
t/live/lib/TestApp/Controller/Action.pm
t/live/lib/TestApp/Controller/Index.pm [new file with mode: 0644]

index 35c397a..2233134 100644 (file)
@@ -21,11 +21,11 @@ for ( 1 .. 1 ) {
     
     # test first-level controller index
     {
-        ok( my $response = request('http://localhost/action/'), 'first-level controller index' );
-        is( $response->content, 'Action index', 'first-level controller index ok' );
+        ok( my $response = request('http://localhost/index/'), 'first-level controller index' );
+        is( $response->content, 'Index index', 'first-level controller index ok' );
         
-        ok( $response = request('http://localhost/action'), 'first-level controller index no slash' );
-        is( $response->content, 'Action index', 'first-level controller index no slash ok' );        
+        ok( $response = request('http://localhost/index'), 'first-level controller index no slash' );
+        is( $response->content, 'Index index', 'first-level controller index no slash ok' );        
     }    
     
     # test second-level controller index
index 3352415..acd8385 100644 (file)
@@ -9,11 +9,6 @@ sub begin : Private {
     $c->response->content_type('text/plain; charset=utf-8');
 }
 
-sub index : Private {
-    my ( $self, $c ) = @_;
-    $c->res->body( 'Action index' );
-}
-
 sub default : Private {
     my ( $self, $c ) = @_;
     $c->res->output("Error - TestApp::Controller::Action\n");
diff --git a/t/live/lib/TestApp/Controller/Index.pm b/t/live/lib/TestApp/Controller/Index.pm
new file mode 100644 (file)
index 0000000..9b655d2
--- /dev/null
@@ -0,0 +1,11 @@
+package TestApp::Controller::Index;
+
+use strict;
+use base 'Catalyst::Base';
+
+sub index : Private {
+    my ( $self, $c ) = @_;
+    $c->res->body( 'Index index' );
+}
+
+1;