Subject: | Bug in tests causes them to fail on Catalyst 5.80 |
Hiya
I had a quick poke in the tests for CatalystX::CRUD, and the test fail
with Catalyst 5.80 is the fact the accessors generated by
MooseX::Emulate::Class::Accessor::Fast won't automatically store a list
ref if you assin multiple values.
This apears to have been a bug in your test code, as I don't think you
intended to do this, it just happened anyway.
Please find attached a diff which fixes the tests behavior, and adds
another test for the current issue.
Subject: | CatalystX-CRUD.diff |
diff -ur ../CatalystX-CRUD-0.37/t/01-file.t ./t/01-file.t
--- ../CatalystX-CRUD-0.37/t/01-file.t 2008-08-22 18:36:08.000000000 +0100
+++ ./t/01-file.t 2009-01-12 04:18:30.000000000 +0000
@@ -1,4 +1,4 @@
-use Test::More tests => 35;
+use Test::More tests => 36;
use strict;
use lib qw( lib t/lib );
use_ok('CatalystX::CRUD::Model::File');
@@ -17,6 +17,7 @@
#dump( $response->headers );
is( $response->headers->{status}, '302', "response was redirect" );
+like( $response->headers->{location}, qr|^http://localhost/file/[^/]+/edit$|, 'Location looked sane');
ok( get('/autoload'), "get /autoload" );
diff -ur ../CatalystX-CRUD-0.37/t/lib/MyApp/Controller/File.pm ./t/lib/MyApp/Controller/File.pm
--- ../CatalystX-CRUD-0.37/t/lib/MyApp/Controller/File.pm 2008-04-07 19:32:34.000000000 +0100
+++ ./t/lib/MyApp/Controller/File.pm 2009-01-12 04:14:16.000000000 +0000
@@ -24,14 +24,14 @@
my ( $self, $c, @arg ) = @_;
- $self->config->{view_on_single_result} = 1;
+ $self->view_on_single_result(1);
my $tmpf = File::Temp->new;
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;
}
Only in ./t/lib/MyApp: root