From: Matt S Trout Date: Sun, 25 Jan 2009 22:27:59 +0000 (+0000) Subject: extract test X-Git-Tag: v0.08240~96^2~9 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f57672336049741b6f7d710e2445743a746a3ab8;p=dbsrgits%2FDBIx-Class.git extract test --- diff --git a/t/96multi_create/cd_single.t b/t/96multi_create/cd_single.t new file mode 100644 index 0000000..53825b8 --- /dev/null +++ b/t/96multi_create/cd_single.t @@ -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'); +};