[Bast-commits] r5545 - DBIx-Class/0.08/branches/multi_stuff/t

matthewt at dev.catalyst.perl.org matthewt at dev.catalyst.perl.org
Fri Feb 20 04:26:22 GMT 2009


Author: matthewt
Date: 2009-02-20 04:26:22 +0000 (Fri, 20 Feb 2009)
New Revision: 5545

Modified:
   DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t
Log:
verify non-staged insertion as well

Modified: DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t
===================================================================
--- DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t	2009-02-20 04:09:04 UTC (rev 5544)
+++ DBIx-Class/0.08/branches/multi_stuff/t/96multi_create_new.t	2009-02-20 04:26:22 UTC (rev 5545)
@@ -6,7 +6,7 @@
 use lib qw(t/lib);
 use DBICTest;
 
-plan tests => 6;
+plan tests => 9;
 
 my $schema = DBICTest->init_schema();
 
@@ -35,6 +35,17 @@
 }
 
 {
+    my $new_artist = $schema->resultset("Artist")->new_result({ 'name' => 'Depeche Mode' });
+    my $new_related_cd = $new_artist->new_related('cds', { 'title' => 'Leave in Silence', 'year' => 1982});
+    eval {
+        $new_related_cd->insert;
+    };
+    is ($@, '', 'CD insertion survives by inserting artist');
+    ok($new_artist->in_storage, 'artist inserted');
+    ok($new_related_cd->in_storage, 'new_related_cd inserted');
+}
+
+{
     my $new_cd = $schema->resultset("CD")->new_result({});
     my $new_related_artist = $new_cd->new_related('artist', { 'name' => 'Marillion',});
     lives_ok (




More information about the Bast-commits mailing list