added tests for RT#63709
[dbsrgits/DBIx-Class.git] / t / prefetch / relationship_where_attr.t
CommitLineData
fd2c0754 1use strict;
2use warnings;
3
4use Test::More;
5use lib qw(t/lib);
6use DBICTest;
7my $schema = DBICTest->init_schema();
8
9{
10 my $artist_with_year2001_cds = $schema->resultset('Artist')->find(1);
11 is $artist_with_year2001_cds->year2001_cds->count, 1, 'artist has one cd from 2001 without prefetching';
12}
13
14{
15 my $artist_with_year2001_cds = $schema->resultset('Artist')->find(1, { prefetch => 'year2001_cds' });
16 is $artist_with_year2001_cds->year2001_cds->count, 1, 'artist has one cd from 2001 with prefetching';
17}
18
19done_testing;