join merging working properly. some torture tests
[dbsrgits/DBIx-Class.git] / t / run / 30join_torture.tl
CommitLineData
1e9e7f58 1sub run_tests {
2my $schema = shift;
3
4plan tests => 2;
5
6my $rs1 = $schema->resultset("Artist")->search({ 'tags.tag' => 'Blue' }, { join => {'cds' => 'tracks'}, prefetch => {'cds' => 'tags'} });
7my @artists = $rs1->all;
8cmp_ok(@artists, '==', 1, "Two artists returned");
9
10my $rs2 = $rs1->search({ artistid => '1' }, { join => {'cds' => {'cd_to_producer' => 'producer'} } });
11my $rs3 = $rs2->search_related('cds')->search({'cds.title' => 'Forkful of bees'});
12cmp_ok($rs3->count, '==', 3, "Three artists returned");
13
14}
151;