sub run_tests {
my $schema = shift;
-plan tests => 30;
+plan tests => 31;
my $artistid = 1;
my $title = 'UNIQUE Constraint';
{ 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');
{ 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');
{ 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');