[Rt-commit] rt branch, new-style-templates, updated. rt-3.8.8-194-gae46231

Shawn Moore sartak at bestpractical.com
Wed Jul 21 17:02:14 EDT 2010


The branch, new-style-templates has been updated
       via  ae462317c67133d96efa4978f9fd9b9e67123923 (commit)
      from  104499173e6539eef5e0730b57017bb70e4b8c17 (commit)

Summary of changes:
 t/api/template-simple.t |   22 +++++++++++++++++++++-
 1 files changed, 21 insertions(+), 1 deletions(-)

- Log -----------------------------------------------------------------
commit ae462317c67133d96efa4978f9fd9b9e67123923
Author: Shawn M Moore <sartak at bestpractical.com>
Date:   Wed Jul 21 17:03:53 2010 -0400

    Template->SetType test

diff --git a/t/api/template-simple.t b/t/api/template-simple.t
index 49c4fa4..c239610 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 => 95;
+use RT::Test tests => 99;
 
 my $ticket = RT::Ticket->new($RT::SystemUser);
 my ($id, $msg) = $ticket->Create(
@@ -61,6 +61,26 @@ TemplateTest(
     SimpleOutput => "test { \$Ticket->OwnerObj->Name }",
 );
 
+# Make sure changing the template's type works
+my $template = RT::Template->new($RT::SystemUser);
+$template->Create(
+    Name    => "type chameleon",
+    Type    => "Full",
+    Content => "\ntest { 10 * 7 }",
+);
+ok($id = $template->id, "Created template");
+$template->Parse;
+is($template->MIMEObj->stringify_body, "test 70", "Full output");
+
+$template = RT::Template->new($RT::SystemUser);
+$template->Load($id);
+is($template->Name, "type chameleon");
+
+$template->SetType('Simple');
+$template->Parse;
+is($template->MIMEObj->stringify_body, "test { 10 * 7 }", "Simple output");
+
+
 my $counter = 0;
 sub IndividualTemplateTest {
     local $Test::Builder::Level = $Test::Builder::Level + 1;

-----------------------------------------------------------------------


More information about the Rt-commit mailing list