[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-190-g271d8cd
Shawn Moore
sartak at bestpractical.com
Wed Jul 21 00:14:32 EDT 2010
The branch, new-style-templates has been updated
via 271d8cdd619df8c1cba1165e2f09eb88e090d45c (commit)
from 55910793b86db6044f91eab269cc1c115414c8a0 (commit)
Summary of changes:
t/api/template-simple.t | 17 ++++++++++++++---
1 files changed, 14 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 271d8cdd619df8c1cba1165e2f09eb88e090d45c
Author: Shawn M Moore <sartak at bestpractical.com>
Date: Wed Jul 21 00:16:10 2010 -0400
Begin testing for template failures
diff --git a/t/api/template-simple.t b/t/api/template-simple.t
index d90bbb8..79d18b9 100644
--- a/t/api/template-simple.t
+++ b/t/api/template-simple.t
@@ -1,7 +1,7 @@
use strict;
use warnings;
use RT;
-use RT::Test tests => 37;
+use RT::Test tests => 48;
my $ticket = RT::Ticket->new($RT::SystemUser);
my ($id, $msg) = $ticket->Create(
@@ -30,6 +30,12 @@ TemplateTest(
SimpleOutput => "test dom\@example.com",
);
+TemplateTest(
+ Content => "\ntest { \$Ticket->Nonexistent }",
+ FullOutput => undef,
+ SimpleOutput => "test { \$Ticket->Nonexistent }",
+);
+
my $counter = 0;
sub IndividualTemplateTest {
local $Test::Builder::Level = $Test::Builder::Level + 1;
@@ -56,8 +62,13 @@ sub IndividualTemplateTest {
TicketObj => $ticket,
TransactionObj => $ticket->Transactions->First,
);
- ok($ok, $msg);
- is($t->MIMEObj->stringify_body, $args{Output}, "template's output");
+ if (defined $args{Output}) {
+ ok($ok, $msg);
+ is($t->MIMEObj->stringify_body, $args{Output}, "template's output");
+ }
+ else {
+ ok(!$ok, "expected failure: $msg");
+ }
}
sub TemplateTest {
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list