diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-02-28 00:04:10 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-02-28 00:04:10 +0000 |
commit | 0c198005f6a84d948e11354912bb6178f3f852eb (patch) | |
tree | 2b6a39ac5415328979f7ad62b775d73f613e14ee /share/www/script | |
parent | 1cb18dc3db07b5a8e795c96e9e566eb621becc89 (diff) |
supply etags for reduce view lists
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@748754 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r-- | share/www/script/test/list_views.js | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/share/www/script/test/list_views.js b/share/www/script/test/list_views.js index a25eed30..5469efd2 100644 --- a/share/www/script/test/list_views.js +++ b/share/www/script/test/list_views.js @@ -193,10 +193,28 @@ couchTests.list_views = function(debug) { T(/Key: 1/.test(xhr.responseText)); // when there is a reduce present, and used - var xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/simpleForm/withReduce?group=true"); + xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/simpleForm/withReduce?group=true"); T(xhr.status == 200); T(/Key: 1/.test(xhr.responseText)); + // there should be etags on reduce as well + var etag = xhr.getResponseHeader("etag"); + T(etag, "Etags should be served with reduce lists"); + xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/simpleForm/withReduce?group=true", { + headers: {"if-none-match": etag} + }); + T(xhr.status == 304); + + // verify the etags expire correctly + var docs = makeDocs(11, 12); + var saveResult = db.bulkSave(docs); + T(saveResult.ok); + + xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/simpleForm/withReduce?group=true", { + headers: {"if-none-match": etag} + }); + T(xhr.status == 200); + // with accept headers for HTML xhr = CouchDB.request("GET", "/test_suite_db/_list/lists/acceptSwitch/basicView", { headers: { |