[Bast-commits] r5350 - in DBIx-Class/0.08/branches/multi_stuff/t: .
96multi_create
matthewt at dev.catalyst.perl.org
matthewt at dev.catalyst.perl.org
Sun Jan 25 22:27:59 GMT 2009
Author: matthewt
Date: 2009-01-25 22:27:59 +0000 (Sun, 25 Jan 2009)
New Revision: 5350
Added:
DBIx-Class/0.08/branches/multi_stuff/t/96multi_create/
DBIx-Class/0.08/branches/multi_stuff/t/96multi_create/cd_single.t
Log:
extract test
Added: DBIx-Class/0.08/branches/multi_stuff/t/96multi_create/cd_single.t
===================================================================
--- DBIx-Class/0.08/branches/multi_stuff/t/96multi_create/cd_single.t (rev 0)
+++ DBIx-Class/0.08/branches/multi_stuff/t/96multi_create/cd_single.t 2009-01-25 22:27:59 UTC (rev 5350)
@@ -0,0 +1,35 @@
+use strict;
+use warnings;
+
+use Test::More qw(no_plan);
+use Test::Exception;
+use lib qw(t/lib);
+use DBICTest;
+
+my $schema = DBICTest->init_schema();
+
+eval {
+ my $cd = $schema->resultset('CD')->first;
+ my $track = $schema->resultset('Track')->new_result({
+ cd => $cd,
+ position => 77, # some day me might test this with Ordered
+ title => 'Multicreate rocks',
+ cd_single => {
+ artist => $cd->artist,
+ year => 2008,
+ title => 'Disemboweling MultiCreate',
+ },
+ });
+
+ isa_ok ($track, 'DBICTest::Track', 'Main Track object created');
+
+ $track->insert;
+
+ ok(1, 'created track');
+
+ is($track->title, 'Multicreate rocks', 'Correct Track title');
+
+ my $single = $track->cd_single;
+
+ ok($single->cdid, 'Got cdid');
+};
More information about the Bast-commits
mailing list