Commit | Line | Data |
bccd177f |
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 | |
1ee9aa72 |
11 | plan tests => 2; |
bccd177f |
12 | |
1ee9aa72 |
13 | ## Real view |
3a8d32fa |
14 | my $cds_rs_2000 = $schema->resultset('CD')->search( { year => 2000 }); |
bccd177f |
15 | my $year2kcds_rs = $schema->resultset('Year2000CDs'); |
16 | |
3a8d32fa |
17 | is($cds_rs_2000->count, $year2kcds_rs->count, 'View Year2000CDs sees all CDs in year 2000'); |
bccd177f |
18 | |
19 | |
1ee9aa72 |
20 | ## Virtual view |
3a8d32fa |
21 | my $cds_rs_1999 = $schema->resultset('CD')->search( { year => 1999 }); |
1ee9aa72 |
22 | my $year1999cds_rs = $schema->resultset('Year1999CDs'); |
23 | |
3a8d32fa |
24 | is($cds_rs_1999->count, $year1999cds_rs->count, 'View Year1999CDs sees all CDs in year 1999'); |
1ee9aa72 |
25 | |
26 | |
27 | |
bccd177f |
28 | |