the class used to create the TT object can now be customized
[catagits/Catalyst-View-TT.git] / t / 07render.t
1 use strict;
2 use warnings;
3 use Test::More tests => 7;
4
5 use FindBin;
6 use lib "$FindBin::Bin/lib";
7
8 use_ok('Catalyst::Test', 'TestApp');
9
10 my $response;
11 ok(($response = request("/test_render?template=specified_template.tt&param=parameterized"))->is_success, 'request ok');
12 is($response->content, "I should be a parameterized test in @{[TestApp->config->{name}]}", 'message ok');
13
14 my $message = 'Dynamic message';
15
16 ok(($response = request("/test_msg?msg=$message"))->is_success, 'request ok');
17 is($response->content, "$message", 'message ok');
18
19 $response = request("/test_render?template=non_existant_template.tt");
20
21 is (403, $response->code, 'request returned error');
22 is($response->content, 'file error - non_existant_template.tt: not found', 'Error from non-existant-template');