Example added to #Actions_in_your_application_class
IƱigo Tejedor Arrondo [Tue, 20 Oct 2009 20:12:46 +0000 (20:12 +0000)]
lib/Catalyst/Upgrading.pod

index 98f2d9d..e0c3ee6 100644 (file)
@@ -307,9 +307,27 @@ COMPONENT method in your @ISA.
 =head2 Actions in your application class
 
 Having actions in your application class will now emit a warning at application
-startup as this is deprecated. It is highly recommended that these actions are moved
+startup as this is deprecated.It is highly recommended that these actions are moved
 into a MyApp::Controller::Root (as demonstrated by the scaffold application
-generated by catalyst.pl)
+generated by catalyst.pl 
+
+This warning, also affects tests. You should move actions in your test, creating a myTest::Controller::Root, like the following example:
+
+    package MyTest::Controller::Root;
+    
+    use strict;
+    use warnings;
+    
+    use parent 'Catalyst::Controller';
+    
+    __PACKAGE__->config(namespace => '');
+    
+    sub action : Local {
+        my ( $self, $c ) = @_;
+        $c->do_something; 
+    }
+    
+    1;
 
 =head2 ::[MVC]:: naming scheme