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