From: Peter Rabbitson Date: Fri, 24 Oct 2008 14:32:17 +0000 (+0000) Subject: complete a test X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4295b5d48b5cf541563b94b510979aec75085008;p=dbsrgits%2FDBIx-Class-Historic.git complete a test --- diff --git a/t/66relationship.t b/t/66relationship.t index ddde6b2..5d8052a 100644 --- a/t/66relationship.t +++ b/t/66relationship.t @@ -7,7 +7,7 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 65; +plan tests => 67; # has_a test my $cd = $schema->resultset("CD")->find(4); @@ -255,12 +255,11 @@ cmp_ok($artist->cds->count, '==', 0, "Correct new #cds for artist"); 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');