Do not alias plain column names to the inflator spec, do it only for funcs
[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
8plan tests => 2;
9
10my $schema = DBICTest->init_schema();
11
12my $track_no_lyrics = $schema->resultset ('Track')
13 ->search ({ 'lyrics.lyric_id' => undef }, { join => 'lyrics' })
14 ->first;
15
16my $lyric = $track_no_lyrics->create_related ('lyrics', {
17 lyric_versions => [
18 { text => 'english doubled' },
19 { text => 'english doubled' },
20 ],
21});
22is ($lyric->lyric_versions->count, 2, "Two identical has_many's created");
23
24
25my $link = $schema->resultset ('Link')->create ({
26 url => 'lolcats!',
27 bookmarks => [
28 {},
29 {},
30 ]
31});
32is ($link->bookmarks->count, 2, "Two identical default-insert has_many's created");