Mercurial > hg > nginx-tests
changeset 687:89cfb7397ba1
Tests: added proxy_store tests with variable.
author | Andrey Zelenkov <zelenkov@nginx.com> |
---|---|
date | Fri, 11 Sep 2015 17:25:42 +0300 |
parents | 0af386a519d2 |
children | d40623cda299 |
files | proxy_store.t |
diffstat | 1 files changed, 9 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/proxy_store.t Fri Sep 11 12:57:13 2015 +0300 +++ b/proxy_store.t Fri Sep 11 17:25:42 2015 +0300 @@ -23,7 +23,7 @@ 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 @@ 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 @@ 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');