This is not update_or_create - create any non-belongs_to without asking many questions
[dbsrgits/DBIx-Class.git] / t / 96multi_create.t
index 9cd754f..856a158 100644 (file)
@@ -6,7 +6,7 @@ use Test::Exception;
 use lib qw(t/lib);
 use DBICTest;
 
-plan tests => 93;
+plan tests => 92;
 
 my $schema = DBICTest->init_schema();
 
@@ -328,7 +328,7 @@ lives_ok ( sub {
   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 => [
@@ -344,9 +344,7 @@ lives_ok ( sub {
       },
     ]
   });
-
-  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;