Commit | Line | Data |
f5767233 |
1 | use strict; |
2 | use warnings; |
3 | |
89bddb49 |
4 | use Test::More; |
f5767233 |
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, |
f5767233 |
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 | }; |
89bddb49 |
34 | |
35 | done_testing; |