Tag 0.31
[catagits/Catalyst-View-TT.git] / tags / 0.31 / t / 06includepath.t
1 use strict;
2 use warnings;
3 use Test::More tests => 10;
4
5 use FindBin;
6 use lib "$FindBin::Bin/lib";
7
8 use_ok('Catalyst::Test', 'TestApp');
9 my $response;
10
11 my $inital_include_path = [ @{ TestApp->view('TT::Appconfig')->include_path } ];
12
13 ok(($response = request("/test_includepath?view=Appconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'additional_template_path request');
14 is($response->content, TestApp->config->{default_message}, 'additional_template_path message');
15
16 is_deeply($inital_include_path,
17     TestApp->view('TT::Appconfig')->include_path,
18     'Include path is unchanged');
19
20 ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'scalar include path from config request');
21 is($response->content, TestApp->config->{default_message}, 'scalar include path with delimiter from config message');
22
23 ok(($response = request("/test_includepath?view=Includepath2&template=testpath.tt"))->is_success, 'object ref (that stringifys to the path) include path from config request');
24 is($response->content, TestApp->config->{default_message}, 'object ref (that stringifys to the path) include path from config message');
25
26 ok(($response = request("/test_includepath?view=Includepath3&template=testpath.tt&addpath=test_include_path"))->is_success, 'array ref include path from config not replaced by another array request');
27 is($response->content, TestApp->config->{default_message}, 'array ref include path from config not replaced by another array message');
28