From c615268d94a7c5b09fd439f71e37210245911d7d Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Sun, 1 Jul 2007 05:15:53 +0000 Subject: [PATCH] fix a bug with the new assetDbProperties method. It used the wrong class --- lib/WebGUI/Asset.pm | 2 +- t/Asset/Wobject/Article.t | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/WebGUI/Asset.pm b/lib/WebGUI/Asset.pm index 9e609017e..4c4b7818c 100644 --- a/lib/WebGUI/Asset.pm +++ b/lib/WebGUI/Asset.pm @@ -113,7 +113,7 @@ sub assetDbProperties { my $sql = "select * from asset"; my $where = " where asset.assetId=?"; my $placeHolders = [$assetId]; - foreach my $definition (@{$class->definition($session)}) { + foreach my $definition (@{$className->definition($session)}) { $sql .= ",".$definition->{tableName}; $where .= " and (asset.assetId=".$definition->{tableName}.".assetId and ".$definition->{tableName}.".revisionDate=".$revisionDate.")"; } diff --git a/t/Asset/Wobject/Article.t b/t/Asset/Wobject/Article.t index 0e231427e..ae941fb83 100644 --- a/t/Asset/Wobject/Article.t +++ b/t/Asset/Wobject/Article.t @@ -17,7 +17,7 @@ use lib "$FindBin::Bin/../../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 20; # increment this value for each test you create +use Test::More tests => 23; # increment this value for each test you create use WebGUI::Asset::Wobject::Article; my $session = WebGUI::Test->session; @@ -108,7 +108,10 @@ is ($duplicateFilename, undef, 'purge method deletes collateral'); # Lets make sure the view method returns something. # This is not a very good test but I need to do it to test the purgeCache method anyways =) +is ($article->{_viewTemplate}, undef, 'internal template cache unset until prepareView is called'); $article->prepareView; +isnt ($article->{_viewTemplate}, undef, 'internal template cache set by prepare view'); +isa_ok ($article->{_viewTemplate}, 'WebGUI::Asset::Template', 'internal template cache'); my $output = $article->view; isnt ($output, "", 'view method returns something');