From: Daniel Westermann-Clark Date: Mon, 17 Apr 2006 20:16:22 +0000 (-0400) Subject: Minor cleanup and check the row is clean X-Git-Tag: v0.07002~75^2~237^2~13 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a4b350b1968e95392a234ae9e6e40186e97d7468;p=dbsrgits%2FDBIx-Class.git Minor cleanup and check the row is clean --- diff --git a/t/run/20unique.tl b/t/run/20unique.tl index 8b6ce3e..e438735 100644 --- a/t/run/20unique.tl +++ b/t/run/20unique.tl @@ -1,7 +1,7 @@ sub run_tests { my $schema = shift; -plan tests => 30; +plan tests => 31; my $artistid = 1; my $title = 'UNIQUE Constraint'; @@ -78,7 +78,7 @@ my $cd6 = $schema->resultset('CD')->find_or_create( { key => 'artist_title' } ); -is($cd6->cdid, $cd1->cdid, 'find or create by specific key: cdid is correct'); +is($cd6->cdid, $cd1->cdid, 'find_or_create by specific key: cdid is correct'); is($cd6->get_column('artist'), $cd1->get_column('artist'), 'artist is correct'); is($cd6->title, $cd1->title, 'title is correct'); is($cd6->year, $cd1->year, 'year is correct'); @@ -93,7 +93,7 @@ my $cd7 = $artist->find_or_create_related('cds', { key => 'artist_title' } ); -is($cd7->cdid, $cd1->cdid, 'find or create related by specific key: cdid is correct'); +is($cd7->cdid, $cd1->cdid, 'find_or_create related by specific key: cdid is correct'); is($cd7->get_column('artist'), $cd1->get_column('artist'), 'artist is correct'); is($cd7->title, $cd1->title, 'title is correct'); is($cd7->year, $cd1->year, 'year is correct'); @@ -107,7 +107,8 @@ my $cd8 = $artist->update_or_create_related('cds', { key => 'artist_title' } ); -is($cd8->cdid, $cd1->cdid, 'update or create related by specific key: cdid is correct'); +ok(! $cd8->is_changed, 'update_or_create by specific key: row is clean'); +is($cd8->cdid, $cd1->cdid, 'cdid is correct'); is($cd8->get_column('artist'), $cd1->get_column('artist'), 'artist is correct'); is($cd8->title, $cd1->title, 'title is correct'); is($cd8->year, 2021, 'year is correct');