summaryrefslogtreecommitdiff
path: root/share/www/script/test/list_views.js
diff options
context:
space:
mode:
Diffstat (limited to 'share/www/script/test/list_views.js')
-rw-r--r--share/www/script/test/list_views.js20
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: {