From ce22acea8e6fa3baac0d043c15bf3d16c7d782a2 Mon Sep 17 00:00:00 2001 From: Roy Johnson Date: Wed, 26 Jul 2006 19:21:04 +0000 Subject: [PATCH] Adding a test --- t/Macro/PageTitle.t | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/t/Macro/PageTitle.t b/t/Macro/PageTitle.t index 452c84d7b..770dc91b6 100644 --- a/t/Macro/PageTitle.t +++ b/t/Macro/PageTitle.t @@ -31,7 +31,24 @@ $session->asset($homeAsset); my $output = WebGUI::Macro::PageTitle::process($session); is($output, $homeAsset->get('title'), 'fetching title for site default asset'); -TODO: { - local $TODO = "Tests to make later"; - ok(0, 'Fetch title from locally made asset with known title'); +# Create a new snippet and set it's title then check it against the macros output +my $snippetTitle = "Roy's Incredible Snippet of Mystery and Intrique"; +my $snippet = $homeAsset->addChild({ + className=>"WebGUI::Asset::Snippet", + title=>$snippetTitle, + menuTitle=>"Test Snippet", + groupIdView=>7, + groupIdEdit=>3, + }); +$session->asset($snippet); +my $macroOutput = WebGUI::Macro::PageTitle::process($session); +is($macroOutput, $snippet->get('title'), "testing title returned from localy created asset with known title"); + +my @added_macros; +END { + foreach my $macro (@added_macros) { + next unless $macro; + $session->config->deleteFromHash("macros", $macro); + } } +