[Bast-commits] r4924 - DBIx-Class/0.08/trunk/t

ribasushi at dev.catalyst.perl.org ribasushi at dev.catalyst.perl.org
Thu Oct 16 19:29:39 BST 2008


Author: ribasushi
Date: 2008-10-16 19:29:38 +0100 (Thu, 16 Oct 2008)
New Revision: 4924

Modified:
   DBIx-Class/0.08/trunk/t/96multi_create.t
Log:
Failing tests for multicreate over m2m (passes with 0.08010)

Modified: DBIx-Class/0.08/trunk/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create.t	2008-10-16 13:41:18 UTC (rev 4923)
+++ DBIx-Class/0.08/trunk/t/96multi_create.t	2008-10-16 18:29:38 UTC (rev 4924)
@@ -217,3 +217,21 @@
     $t->insert;
 };
 like($@, qr/cd.artist may not be NULL/, "Exception propogated properly");
+
+# Test multi create over many_to_many
+eval {
+    $schema->resultset('CD')->create ({
+        artist => $new_artist,
+        title => 'Warble Marble',
+        year => '2009',
+        cd_to_producer => [
+            { producer => { name => 'Cowboy Neal' } },
+        ],
+    });
+
+    my $m2m_cd = $schema->resultset('CD')->search ({ title => 'Warble Marble'});
+    is ($m2m_cd->count, 1, 'One CD object created via M2M create');
+    is ($m2m_cd->first->producers->count, 1, 'CD object created with one producer');
+    is ($m2m_cd->first->producers->first->name, 'Cowboy Neal', 'Correct producer object created');
+};
+ok (! $@, 'No exceptions on m2m create');




More information about the Bast-commits mailing list