diff options
author | John Christopher Anderson <jchris@apache.org> | 2009-08-12 03:20:21 +0000 |
---|---|---|
committer | John Christopher Anderson <jchris@apache.org> | 2009-08-12 03:20:21 +0000 |
commit | dc665a05644774f232718dd7c35dd1aac34f389e (patch) | |
tree | cb57fa6deaaf3f268f0b47573bbcbb9cf178be59 /share/www/script/test/etags_views.js | |
parent | d726977bfa8d73ac8928c5379dd5b5c50ae2c38f (diff) |
recloses COUCHDB-4 (view etags) thanks to Matt Goodall for the tests. keep 'em coming!
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@803358 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 | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/share/www/script/test/etags_views.js b/share/www/script/test/etags_views.js index 3d8b63b7..a33317d9 100644 --- a/share/www/script/test/etags_views.js +++ b/share/www/script/test/etags_views.js @@ -83,4 +83,21 @@ couchTests.etags_views = function(debug) { // list etag // in the list test for now + + // A new database should have unique _all_docs etags. + db.deleteDb(); + db.createDb(); + db.save({a: 1}); + xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); + var etag = xhr.getResponseHeader("etag"); + db.deleteDb(); + db.createDb(); + db.save({a: 2}); + xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); + var new_etag = xhr.getResponseHeader("etag"); + T(etag != new_etag); + // but still be cacheable + xhr = CouchDB.request("GET", "/test_suite_db/_all_docs"); + T(new_etag == xhr.getResponseHeader("etag")); + }; |