X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmulti_create%2Fhas_many.t;h=2878ff77c0511e347fd4c5ffee8bacbe3bf49d6a;hb=21aa86aae083ccb5b94ba994dec030627e95e40b;hp=2d6818ea72aca1b7d8de01106f30517fe71f798e;hpb=49377893677d11e23e6744198378116fa7c1a1ef;p=dbsrgits%2FDBIx-Class.git diff --git a/t/multi_create/has_many.t b/t/multi_create/has_many.t index 2d6818e..2878ff7 100644 --- a/t/multi_create/has_many.t +++ b/t/multi_create/has_many.t @@ -2,28 +2,22 @@ use strict; use warnings; use Test::More; -use Test::Exception; use lib qw(t/lib); use DBICTest; -plan tests => 2; - my $schema = DBICTest->init_schema(); -my $track_no_lyrics = $schema->resultset ('Track') - ->search ({ 'lyrics.lyric_id' => undef }, { join => 'lyrics' }) - ->first; - -my $lyric = $track_no_lyrics->create_related ('lyrics', { - lyric_versions => [ - { text => 'english doubled' }, - { text => 'english doubled' }, - ], +my $link = $schema->resultset ('Link')->create ({ + url => 'loldogs!', + bookmarks => [ + { link => 'Mein Hund ist schwul'}, + { link => 'Mein Hund ist schwul'}, + ] }); -is ($lyric->lyric_versions->count, 2, "Two identical has_many's created"); +is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created"); -my $link = $schema->resultset ('Link')->create ({ +$link = $schema->resultset ('Link')->create ({ url => 'lolcats!', bookmarks => [ {}, @@ -31,3 +25,5 @@ my $link = $schema->resultset ('Link')->create ({ ] }); is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created"); + +done_testing;