# HG changeset patch # User Andrey Zelenkov # Date 1441981542 -10800 # Node ID 89cfb7397ba1a38ec383c79c4125b1674f5fc4cc # Parent 0af386a519d205da876cc3dd559bb545a045fdbd Tests: added proxy_store tests with variable. diff --git a/proxy_store.t b/proxy_store.t --- a/proxy_store.t +++ b/proxy_store.t @@ -23,7 +23,7 @@ select STDOUT; $| = 1; my $t = Test::Nginx->new(); -$t->write_file_expand('nginx.conf', <<'EOF')->has(qw/http proxy ssi/)->plan(7); +$t->write_file_expand('nginx.conf', <<'EOF')->has(qw/http proxy ssi/)->plan(9); %%TEST_GLOBALS%% @@ -43,6 +43,10 @@ http { proxy_pass http://127.0.0.1:8080/; proxy_store on; } + location /store-string- { + proxy_pass http://127.0.0.1:8080/; + proxy_store %%TESTDIR%%$uri; + } location /ssi.html { ssi on; } @@ -68,6 +72,10 @@ EOF like(http_get('/store-index.html'), qr/SEE-THIS/, 'proxy request'); ok(-e $t->testdir() . '/store-index.html', 'result stored'); +like(http_get('/store-string-index.html'), qr/SEE-THIS/, + 'proxy string path request'); +ok(-e $t->testdir() . '/store-string-index.html', 'string path result stored'); + like(http_head('/store-index-nostore.html'), qr/200 OK/, 'head request'); ok(!-e $t->testdir() . '/store-index-nostore.html', 'result not stored');