X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmulti_create%2Fhas_many.t;fp=t%2Fmulti_create%2Fhas_many.t;h=2878ff77c0511e347fd4c5ffee8bacbe3bf49d6a;hb=908aa1bb761ec1da5c061fe9f687598e3f1934bc;hp=716a9a395cddc8b3d3e7fe94f97859efbd620d4c;hpb=fe0708a2d68b5d34b6bc6f7e70164c3e569f1dd0;p=dbsrgits%2FDBIx-Class.git diff --git a/t/multi_create/has_many.t b/t/multi_create/has_many.t index 716a9a3..2878ff7 100644 --- a/t/multi_create/has_many.t +++ b/t/multi_create/has_many.t @@ -5,24 +5,19 @@ use Test::More; 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 => [ {}, @@ -30,3 +25,5 @@ my $link = $schema->resultset ('Link')->create ({ ] }); is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created"); + +done_testing;