From: Jess Robinson Date: Thu, 19 Feb 2009 22:12:20 +0000 (+0000) Subject: Add tests for virtual view X-Git-Tag: v0.08240~88^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1ee9aa728c714ad8e501297e86c1fb513687238c;p=dbsrgits%2FDBIx-Class.git Add tests for virtual view --- diff --git a/t/104view.t b/t/104view.t index f800af4..0539d48 100644 --- a/t/104view.t +++ b/t/104view.t @@ -8,12 +8,21 @@ use DBICTest; my $schema = DBICTest->init_schema(); -plan tests => 1; +plan tests => 2; +## Real view my $cds_rs = $schema->resultset('CD')->search( { year => 2000 }); my $year2kcds_rs = $schema->resultset('Year2000CDs'); is($cds_rs->count, $year2kcds_rs->count, 'View Year2000CDs sees all CDs in year 2000'); +## Virtual view +my $cds_rs = $schema->resultset('CD')->search( { year => 1999 }); +my $year1999cds_rs = $schema->resultset('Year1999CDs'); + +is($cds_rs->count, $year1999cds_rs->count, 'View Year1999CDs sees all CDs in year 1999'); + + + diff --git a/t/lib/DBICTest/Schema.pm b/t/lib/DBICTest/Schema.pm index 45bcd9e..319ffec 100644 --- a/t/lib/DBICTest/Schema.pm +++ b/t/lib/DBICTest/Schema.pm @@ -19,6 +19,7 @@ __PACKAGE__->load_classes(qw/ Track Tag Year2000CDs + Year1999CDs /, { 'DBICTest::Schema' => [qw/ LinerNotes diff --git a/t/lib/sqlite.sql b/t/lib/sqlite.sql index c827fcf..8429fa8 100644 --- a/t/lib/sqlite.sql +++ b/t/lib/sqlite.sql @@ -1,6 +1,6 @@ -- -- Created by SQL::Translator::Producer::SQLite --- Created on Wed Feb 18 22:31:31 2009 +-- Created on Thu Feb 19 22:09:32 2009 --