746eaab323ebef09bb5a96a3b3350a16c5cb3186
[dbsrgits/DBIx-Class.git] / t / multi_create / cd_single.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use lib qw(t/lib);
6 use DBICTest;
7
8 my $schema = DBICTest->init_schema();
9
10 eval {
11   my $cd = $schema->resultset('CD')->first;
12   my $track = $schema->resultset('Track')->new_result({
13     cd => $cd,
14     title => 'Multicreate rocks',
15     cd_single => {
16       artist => $cd->artist,
17       year => 2008,
18       title => 'Disemboweling MultiCreate',
19     },
20   });
21
22   isa_ok ($track, 'DBICTest::Track', 'Main Track object created');
23
24   $track->insert;
25
26   ok(1, 'created track');
27
28   is($track->title, 'Multicreate rocks', 'Correct Track title');
29
30   my $single = $track->cd_single;
31
32   ok($single->cdid, 'Got cdid');
33 };
34
35 done_testing;