Commit | Line | Data |
a7afecf7 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use FindBin; |
5 | use lib "$FindBin::Bin/lib"; |
6 | |
3af1b75e |
7 | use Test::More tests => 5; |
a7afecf7 |
8 | |
1818b6bc |
9 | BEGIN { |
10 | # Remove all relevant env variables to avoid accidental fail |
11 | foreach my $name ( grep { m{^(CATALYST)} } keys %ENV ) { |
12 | delete $ENV{ $name }; |
13 | } |
14 | } |
15 | |
a7afecf7 |
16 | use Catalyst::Test 'TestApp'; |
17 | |
18 | { |
19 | my $response; |
587d381b |
20 | ok( $response = request( 'http://localhost/config/' ), 'request ok' ); |
a7afecf7 |
21 | is( $response->content, 'foo', 'config ok' ); |
22 | |
587d381b |
23 | $response = request( 'http://localhost/appconfig/cache' ); |
24 | ok( $response->content !~ /^__HOME__/, |
25 | 'home dir substituted in config var' |
26 | ); |
a7afecf7 |
27 | |
587d381b |
28 | $response = request( 'http://localhost/appconfig/foo' ); |
a7afecf7 |
29 | is( $response->content, 'bar', 'app finalize_config works' ); |
3af1b75e |
30 | |
587d381b |
31 | $response = request( 'http://localhost/appconfig/multi' ); |
3af1b75e |
32 | my $home = TestApp->config->{ home }; |
587d381b |
33 | my $path = join( ',', |
34 | $home, TestApp->path_to( 'x' ), |
35 | $home, TestApp->path_to( 'y' ) ); |
3af1b75e |
36 | is( $response->content, $path, 'vars substituted in config var, twice' ); |
a7afecf7 |
37 | } |