[Catalyst-commits] r8982 - in CatalystX-CRUD/CatalystX-CRUD/trunk: . t t/lib/MyApp/Controller

karpet at dev.catalyst.perl.org karpet at dev.catalyst.perl.org
Tue Dec 30 15:16:20 GMT 2008


Author: karpet
Date: 2008-12-30 15:16:19 +0000 (Tue, 30 Dec 2008)
New Revision: 8982

Modified:
   CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
   CatalystX-CRUD/CatalystX-CRUD/trunk/t/00-load.t
   CatalystX-CRUD/CatalystX-CRUD/trunk/t/lib/MyApp/Controller/File.pm
Log:
fix view_on_single_result bug

Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/Changes
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/Changes	2008-12-30 10:01:19 UTC (rev 8981)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/Changes	2008-12-30 15:16:19 UTC (rev 8982)
@@ -186,3 +186,7 @@
 0.37    8 Dec 2008
         * support x-tunneled-method for DELETE in save() calls
 
+0.38    xxx
+        * use maybe::next::method
+        * fix view_on_single_result bug in Test::Controller
+

Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/t/00-load.t
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/t/00-load.t	2008-12-30 10:01:19 UTC (rev 8981)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/t/00-load.t	2008-12-30 15:16:19 UTC (rev 8982)
@@ -1,4 +1,4 @@
-#!perl -T
+#!perl 
 
 use Test::More tests => 9;
 

Modified: CatalystX-CRUD/CatalystX-CRUD/trunk/t/lib/MyApp/Controller/File.pm
===================================================================
--- CatalystX-CRUD/CatalystX-CRUD/trunk/t/lib/MyApp/Controller/File.pm	2008-12-30 10:01:19 UTC (rev 8981)
+++ CatalystX-CRUD/CatalystX-CRUD/trunk/t/lib/MyApp/Controller/File.pm	2008-12-30 15:16:19 UTC (rev 8982)
@@ -7,13 +7,14 @@
 use MyApp::Form;
 
 __PACKAGE__->config(
-    primary_key => 'absolute',
-    form_class  => 'MyApp::Form',
-    form_fields => [qw( file content )],
-    model_name  => 'File',
-    primary_key => 'file',
-    init_form   => 'init_with_file',
-    init_object => 'file_from_form',
+    primary_key           => 'absolute',
+    form_class            => 'MyApp::Form',
+    form_fields           => [qw( file content )],
+    model_name            => 'File',
+    primary_key           => 'file',
+    init_form             => 'init_with_file',
+    init_object           => 'file_from_form',
+    view_on_single_result => 1,
 );
 
 # test the view_on_single_result method
@@ -31,7 +32,7 @@
     my $file = $c->model( $self->model_name )
         ->new_object( file => $tmpf->filename );
 
-    if ( my $uri = $self->view_on_single_result( $c, [$file] ) ) {
+    if ( my $uri = $self->uri_for_view_on_single_result( $c, [$file] ) ) {
         $c->response->redirect($uri);
         return;
     }




More information about the Catalyst-commits mailing list