This code belogs in Storage::DBI
[dbsrgits/DBIx-Class-Historic.git] / t / 104view.t
1 use strict;
2 use warnings;  
3
4 use Test::More;
5 use Test::Exception;
6 use lib qw(t/lib);
7 use DBICTest;
8
9 my $schema = DBICTest->init_schema();
10
11 plan tests => 2;
12
13 ## Real view
14 my $cds_rs_2000 = $schema->resultset('CD')->search( { year => 2000 });
15 my $year2kcds_rs = $schema->resultset('Year2000CDs');
16
17 is($cds_rs_2000->count, $year2kcds_rs->count, 'View Year2000CDs sees all CDs in year 2000');
18
19
20 ## Virtual view
21 my $cds_rs_1999 = $schema->resultset('CD')->search( { year => 1999 });
22 my $year1999cds_rs = $schema->resultset('Year1999CDs');
23
24 is($cds_rs_1999->count, $year1999cds_rs->count, 'View Year1999CDs sees all CDs in year 1999');
25
26
27
28