my $schema = DBICTest->init_schema();
-plan tests => 65;
+plan tests => 67;
# has_a test
my $cd = $schema->resultset("CD")->find(4);
cmp_ok($nartist->cds->count, '==', 2, "Correct new #cds for artist");
my $new_artist = $schema->resultset("Artist")->new_result({ 'name' => 'Depeche Mode' });
-# why must i tell him: make a new related from me and me is me? that works!
-# my $new_related_cd = $new_artist->new_related('cds', { 'title' => 'Leave in Silence', 'year' => 1982, 'artist' => $new_artist });
my $new_related_cd = $new_artist->new_related('cds', { 'title' => 'Leave in Silence', 'year' => 1982});
eval {
$new_artist->insert;
$new_related_cd->insert;
};
-$@ && diag($@);
-ok($new_related_cd->in_storage, 'new_related_cd insert ok');
+is ($@, '', 'Staged insertion successful');
+ok($new_artist->in_storage, 'artist inserted');
+ok($new_related_cd->in_storage, 'new_related_cd inserted');