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