Version 0.32
[catagits/Catalyst-Plugin-ConfigLoader.git] / t / 10-live_auto.t
CommitLineData
a7afecf7 1use strict;
2use warnings;
3
4use FindBin;
5use lib "$FindBin::Bin/lib";
6
3af1b75e 7use Test::More tests => 5;
a7afecf7 8
9use Catalyst::Test 'TestApp';
10
11{
12 my $response;
587d381b 13 ok( $response = request( 'http://localhost/config/' ), 'request ok' );
a7afecf7 14 is( $response->content, 'foo', 'config ok' );
15
587d381b 16 $response = request( 'http://localhost/appconfig/cache' );
17 ok( $response->content !~ /^__HOME__/,
18 'home dir substituted in config var'
19 );
a7afecf7 20
587d381b 21 $response = request( 'http://localhost/appconfig/foo' );
a7afecf7 22 is( $response->content, 'bar', 'app finalize_config works' );
3af1b75e 23
587d381b 24 $response = request( 'http://localhost/appconfig/multi' );
3af1b75e 25 my $home = TestApp->config->{ home };
587d381b 26 my $path = join( ',',
27 $home, TestApp->path_to( 'x' ),
28 $home, TestApp->path_to( 'y' ) );
3af1b75e 29 is( $response->content, $path, 'vars substituted in config var, twice' );
a7afecf7 30}