my $re = $self->result_source
->related_source($relname)
->resultset
- ->find_or_create($them);
+ ->create($them);
%{$obj} = %{$re};
MULTICREATE_DEBUG and warn "MC $self new $relname $obj";
}
use lib qw(t/lib);
use DBICTest;
-plan tests => 93;
+plan tests => 92;
my $schema = DBICTest->init_schema();
is($newartist2->name, 'Fred 3', 'Created new artist with cds via find_or_create');
}, 'Nested find_or_create');
-lives_ok ( sub {
+throws_ok ( sub {
my $artist2 = $schema->resultset('Artist')->create({
name => 'Fred 4',
cds => [
},
]
});
-
- is($artist2->in_storage, 1, 'artist with duplicate rels inserted okay');
-}, 'Multiple same level has_many create');
+}, qr/title are not unique/, 'Multiple same level has_many create fails with duplicate error');
lives_ok ( sub {
my $artist = $schema->resultset('Artist')->first;