Mercurial > hg > nginx-tests
diff http_try_files.t @ 214:35d050d7d5f1
Tests: add try_files test with short uri (ticket #152).
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Tue, 24 Apr 2012 14:21:59 +0400 |
parents | 802fc0786165 |
children | ba992cfdc606 |
line wrap: on
line diff
--- a/http_try_files.t Fri Mar 23 20:28:26 2012 +0400 +++ b/http_try_files.t Tue Apr 24 14:21:59 2012 +0400 @@ -21,7 +21,7 @@ select STDERR; $| = 1; select STDOUT; $| = 1; -my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(3) +my $t = Test::Nginx->new()->has(qw/http rewrite/)->plan(4) ->write_file_expand('nginx.conf', <<'EOF'); %%TEST_GLOBALS%% @@ -46,6 +46,10 @@ try_files $uri /fallback_nouri; } + location /short/ { + try_files /short $uri =404; + } + location /fallback { proxy_pass http://127.0.0.1:8081/fallback; } @@ -74,6 +78,7 @@ like(http_get('/found.html'), qr!SEE THIS!, 'found'); like(http_get('/uri/notfound'), qr!X-URI: /fallback!, 'not found uri'); +like(http_get('/short/long'), qr!404 Not!, 'short uri in try_files'); TODO: { local $TODO = 'fixed in 1.1.12';