first cut of grep_cache feature
[dbsrgits/DBIx-Class.git] / t / dq / grep_cache.t
CommitLineData
c1b38300 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Exception;
6use Test::Warn;
7use lib qw(t/lib);
8use DBICTest;
9use DBIC::SqlMakerTest;
10use Data::Query::ExprDeclare;
11
12my $schema = DBICTest->init_schema();
13
14my $cds = $schema->resultset('CD');
15
16my $restricted = $cds->search({}, { cache => 1, grep_cache => 1 })
17 ->search({ 'me.artist' => 1 });
18
19is($restricted->count, 3, 'Count on restricted ok');
20
21$restricted = $cds->search(
22 {},
23 { prefetch => 'artist', cache => 1, grep_cache => 1 }
24 )
25 ->search({ 'artist.name' => 'Caterwauler McCrae' });
26
27is($restricted->count, 3, 'Count on restricted ok via join');
28
29done_testing;