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