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

captainL at dev.catalyst.perl.org captainL at dev.catalyst.perl.org
Sun May 11 19:43:58 BST 2008


Author: captainL
Date: 2008-05-11 19:43:58 +0100 (Sun, 11 May 2008)
New Revision: 4378

Modified:
   DBIx-Class/0.08/trunk/t/96multi_create.t
Log:
added test for find or create related functionality in nested inserts

Modified: DBIx-Class/0.08/trunk/t/96multi_create.t
===================================================================
--- DBIx-Class/0.08/trunk/t/96multi_create.t	2008-05-10 21:05:39 UTC (rev 4377)
+++ DBIx-Class/0.08/trunk/t/96multi_create.t	2008-05-11 18:43:58 UTC (rev 4378)
@@ -196,6 +196,20 @@
 is($new_cd->artist->id, 17, 'new id retained okay');
 
 
+# Test find or create related functionality
+my $new_artist = $schema->resultset("Artist")->create({ artistid => 18, name => 'larry' });
+my $new_cd_hashref2 = { 
+              cdid => 28, 
+               title => 'Boogie Wiggle', 
+              year => '2007', 
+              artist => { artistid => 18, name => 'larry' }
+             };
+
+eval {
+	$schema->resultset("CD")->create($new_cd_hashref2);
+};
+is($@, '', 'new artist created without clash');
+
 # Make sure exceptions from errors in created rels propogate
 eval {
     my $t = $schema->resultset("Track")->new({});




More information about the Bast-commits mailing list