Initial full test pass - all fetches are eager for now
[dbsrgits/DBIx-Class.git] / t / multi_create / has_many.t
CommitLineData
49377893 1use strict;
2use warnings;
3
4use Test::More;
49377893 5use lib qw(t/lib);
6use DBICTest;
7
49377893 8my $schema = DBICTest->init_schema();
9
908aa1bb 10my $link = $schema->resultset ('Link')->create ({
11 url => 'loldogs!',
12 bookmarks => [
13 { link => 'Mein Hund ist schwul'},
14 { link => 'Mein Hund ist schwul'},
15 ]
49377893 16});
908aa1bb 17is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created");
49377893 18
19
908aa1bb 20$link = $schema->resultset ('Link')->create ({
49377893 21 url => 'lolcats!',
22 bookmarks => [
23 {},
24 {},
25 ]
26});
27is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created");
908aa1bb 28
29done_testing;