diff options
author | Adam Kocoloski <kocolosk@apache.org> | 2009-11-30 18:33:59 +0000 |
---|---|---|
committer | Adam Kocoloski <kocolosk@apache.org> | 2009-11-30 18:33:59 +0000 |
commit | b409b8836b82612880df1628cf831d0420e5eb2a (patch) | |
tree | a6f9052f5f1d9446c0a36191aa23ded7bce93e94 /share/www/script/test/etags_views.js | |
parent | 85809452290b99a0a00a91dd319b82f51f9f0c4a (diff) |
ETags on POSTs to _view and _list should depend on Keys. COUCHDB-586
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@885529 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/etags_views.js')
-rw-r--r-- | share/www/script/test/etags_views.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/share/www/script/test/etags_views.js b/share/www/script/test/etags_views.js index 8d248983..a12734f8 100644 --- a/share/www/script/test/etags_views.js +++ b/share/www/script/test/etags_views.js @@ -63,6 +63,29 @@ couchTests.etags_views = function(debug) { }); T(xhr.status == 304); + // confirm ETag changes with different POST bodies + xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView", + {body: JSON.stringify({keys:[1]})} + ); + var etag1 = xhr.getResponseHeader("etag"); + xhr = CouchDB.request("POST", "/test_suite_db/_design/etags/_view/basicView", + {body: JSON.stringify({keys:[2]})} + ); + var etag2 = xhr.getResponseHeader("etag"); + T(etag1 != etag2, "POST to map view generates key-depdendent ETags"); + + xhr = CouchDB.request("POST", + "/test_suite_db/_design/etags/_view/withReduce?group=true", + {body: JSON.stringify({keys:[1]})} + ); + etag1 = xhr.getResponseHeader("etag"); + xhr = CouchDB.request("POST", + "/test_suite_db/_design/etags/_view/withReduce?group=true", + {body: JSON.stringify({keys:[2]})} + ); + etag2 = xhr.getResponseHeader("etag"); + T(etag1 != etag2, "POST to reduce view generates key-depdendent ETags"); + // all docs xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); T(xhr.status == 200); |