added tests for RT#63709
[dbsrgits/DBIx-Class.git] / t / prefetch / relationship_where_attr.t
1 use strict;
2 use warnings;
3
4 use Test::More;
5 use lib qw(t/lib);
6 use DBICTest;
7 my $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
19 done_testing;