From e4d3e5839f599132b041805c2c9b383cd21d56f5 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Wed, 18 Oct 2006 22:42:58 +0000 Subject: [PATCH] Added 3 new tests to article for the view method, caching of the view method, and the purgeCache method. They aren't quite working right yet though... --- t/Asset/Wobject/Article.t | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/t/Asset/Wobject/Article.t b/t/Asset/Wobject/Article.t index addc6e567..4d91b8e6e 100644 --- a/t/Asset/Wobject/Article.t +++ b/t/Asset/Wobject/Article.t @@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../../lib"; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 19; # increment this value for each test you create +use Test::More tests => 20; # increment this value for each test you create use WebGUI::Asset::Wobject::Article; my $session = WebGUI::Test->session; @@ -100,20 +100,33 @@ 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 =) + +my $output = $article->view; +isnt ($output, "", 'view method returns something'); + +# Lets see if caching works +my $cachedOutput = WebGUI::Cache->new($session, 'view_'.$article->getId)->get; +is ($output, $cachedOutput, 'view method caches output'); + +# Lets see if the purgeCache method works +$article->purgeCache; +isnt ($output, $cachedOutput, 'purgeCache method deletes cache'); + + TODO: { local $TODO = "Tests to make later"; ok(0, 'Test exportAssetData method'); ok(0, 'Test getStorageLocation method'); ok(0, 'Test indexContent method'); - ok(0, 'Test purgeCache method'); ok(0, 'Test purgeRevision method'); - ok(0, 'Test view method... maybe?'); ok(0, 'Test www_deleteFile method'); ok(0, 'Test www_view method... maybe?'); } END { # Clean up after thy self - $versionTag->rollback($versionTag->getId); + #$versionTag->rollback($versionTag->getId); }