changeset 47:bb6d65d833cd

Tests: test for X-Accel-Expires switching off proxy_store.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 11 Nov 2008 14:34:43 +0300
parents 239a346b4913
children acfafb52d393
files proxy-store.t
diffstat 1 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/proxy-store.t
+++ b/proxy-store.t
@@ -9,7 +9,7 @@
 use warnings;
 use strict;
 
-use Test::More tests => 2;
+use Test::More tests => 5;
 
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
@@ -48,12 +48,20 @@ http {
             proxy_pass http://127.0.0.1:8080/index.html;
             proxy_store on;
         }
+        location /nostore {
+            proxy_pass http://127.0.0.1:8080/index-nostore.html;
+            proxy_store on;
+        }
+        location /index-nostore.html {
+            add_header  X-Accel-Expires  0;
+        }
     }
 }
 
 EOF
 
 $t->write_file('index.html', 'SEE-THIS');
+$t->write_file('index-nostore.html', 'SEE-THIS');
 $t->run();
 
 ###############################################################################
@@ -61,4 +69,14 @@ EOF
 like(http_get('/store'), qr/SEE-THIS/, 'proxy request');
 ok(-e $t->testdir() . '/store', 'result stored');
 
+like(http_get('/nostore'), qr/SEE-THIS/, 'proxy request with x-accel-expires');
+
+TODO: {
+local $TODO = 'patch under review';
+
+ok(!-e $t->testdir() . '/nostore', 'result not stored');
+}
+
+ok(scalar @{[ glob $t->testdir() . '/proxy_temp/*' ]} == 0, 'no temp files');
+
 ###############################################################################