Add a test for evaluating templates and macros in the right order

in the Snippet.  Fix a bug with that.
This commit is contained in:
Colin Kuskie 2009-01-12 22:23:41 +00:00
parent 1af2704e0c
commit e3c77d4e80
3 changed files with 28 additions and 8 deletions

View file

@ -16,7 +16,7 @@ use lib "$FindBin::Bin/../lib";
use WebGUI::Test;
use WebGUI::Session;
use Test::More tests => 14; # increment this value for each test you create
use Test::More tests => 15; # increment this value for each test you create
use WebGUI::Asset::Snippet;
my $session = WebGUI::Test->session;
@ -70,6 +70,24 @@ isnt ($wwwViewOutput, undef, 'www_view returns something');
my $editOutput = $snippet->www_edit;
isnt ($editOutput, undef, 'www_edit returns something');
$snippet->update({
title => "authMethod",
processAsTemplate => 1,
cacheTimeout => 1,
snippet => q|^SQL(select value from settings where name="<tmpl_var title>");|
});
my $sqlMacroAdded = exists $session->config->get('macros')->{'SQL'};
if (! $sqlMacroAdded) {
$session->config->addToHash('macros', 'SQL', 'SQL');
}
is($snippet->view(), 'WebGUI', 'Interpolating macros in works with template in the correct order');
if (! $sqlMacroAdded) {
$session->config->deleteFromHash('macros', 'SQL');
}
TODO: {
local $TODO = "Tests to make later";
ok(0, 'Test indexContent method');