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