changeset 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 4ac0807cc3cf
children 7f5095965c88
files http_try_files.t
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/http_try_files.t
+++ b/http_try_files.t
@@ -21,7 +21,7 @@ use Test::Nginx;
 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 @@ http {
             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 @@ EOF
 
 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';