Added a test for direct rendering of a template from a view object, without a
David E. Wheeler [Wed, 2 Sep 2009 22:59:08 +0000 (22:59 +0000)]
request.

Changes
t/11norequest.t [new file with mode: 0644]

diff --git a/Changes b/Changes
index c99f0b7..f6fafb0 100644 (file)
--- a/Changes
+++ b/Changes
@@ -9,6 +9,8 @@ Revision history for Perl extension Catalyst::View::TT.
             (Gunnar Strand)
         - "use warnings" in Catalyst::View::TT and output from the TT helper
         - Expand TTSite documentation (RT #33838)
+        - Added a test for direct rendering of a template from a view object,
+          without a request.
 
 0.29    2009-02-20 14:43:00
         - Remove extra unwanted .gitignore from manifest
diff --git a/t/11norequest.t b/t/11norequest.t
new file mode 100644 (file)
index 0000000..9a562b0
--- /dev/null
@@ -0,0 +1,13 @@
+use strict;
+use warnings;
+use Test::More tests => 4;
+
+use FindBin;
+use lib "$FindBin::Bin/lib";
+
+BEGIN { use_ok 'TestApp' or die }
+
+ok my $c  = TestApp->new, 'Instantiate app object';
+ok my $tt = $c->view('TT'), 'Get TT view object';
+is $tt->render($c, 'test.tt', { message => 'hello' }), 'hello',
+    'render() should return the template output';