File: 06includepath.t

package info (click to toggle)
libcatalyst-view-tt-perl 0.34-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 324 kB
  • ctags: 164
  • sloc: perl: 2,324; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 1,523 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use strict;
use warnings;
use Test::More tests => 10;

use FindBin;
use lib "$FindBin::Bin/lib";

use_ok('Catalyst::Test', 'TestApp');
my $response;

my $inital_include_path = [ @{ TestApp->view('TT::Appconfig')->include_path } ];

ok(($response = request("/test_includepath?view=Appconfig&template=testpath.tt&additionalpath=test_include_path"))->is_success, 'additional_template_path request');
is($response->content, TestApp->config->{default_message}, 'additional_template_path message');

is_deeply($inital_include_path,
    TestApp->view('TT::Appconfig')->include_path,
    'Include path is unchanged');

ok(($response = request("/test_includepath?view=Includepath&template=testpath.tt"))->is_success, 'scalar include path from config request');
is($response->content, TestApp->config->{default_message}, 'scalar include path with delimiter from config message');

ok(($response = request("/test_includepath?view=Includepath2&template=testpath.tt"))->is_success, 'object ref (that stringifys to the path) include path from config request');
is($response->content, TestApp->config->{default_message}, 'object ref (that stringifys to the path) include path from config message');

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');
is($response->content, TestApp->config->{default_message}, 'array ref include path from config not replaced by another array message');