From 30a47092be8fc05862d729e1ad442d760a0ac8c3 Mon Sep 17 00:00:00 2001 From: Colin Kuskie Date: Fri, 6 Oct 2006 23:44:21 +0000 Subject: [PATCH] add test for macro processing of genAddHeadTags and for handling of invalid template Id in process for Session::Style --- t/Session/Style.t | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/t/Session/Style.t b/t/Session/Style.t index d7672ca62..7bbb21b21 100644 --- a/t/Session/Style.t +++ b/t/Session/Style.t @@ -16,7 +16,7 @@ use HTML::TokeParser; use WebGUI::Test; use WebGUI::Session; -use Test::More tests => 34; # increment this value for each test you create +use Test::More tests => 35; # increment this value for each test you create use Test::Deep; my $session = WebGUI::Test->session; @@ -141,10 +141,20 @@ TODO: { # #################################################### -TODO: { - local $TODO = "more generateAdditionalHeadTags tests"; - ok(0, 'check for Macro processing in generateAdditionalHeadTags'); -} +$session->user({userId => 1}); +$style->setRawHeadTags("^#;"); +my $macroOutput = $style->generateAdditionalHeadTags(); +is($macroOutput, 1, 'generateAdditionalHeadTags: process a macro'); + +#################################################### +# +# process +# +#################################################### + +is($style->process('body.content', 'notATemplateId'), +"WebGUI was unable to instantiate your style template.body.content", +'process: invalid templateId returns error message to client'); sub simpleLinkParser { my ($tokenName, $text) = @_;