summaryrefslogtreecommitdiff
path: root/share/www/script/test
diff options
context:
space:
mode:
authorFilipe David Borba Manana <fdmanana@apache.org>2010-10-25 18:06:02 +0000
committerFilipe David Borba Manana <fdmanana@apache.org>2010-10-25 18:06:02 +0000
commit7bb18fb537cdf4546aa4aabe794815bf6ee9a2ba (patch)
tree363a52b2a7fefa04057a37f38f1220a0aecd1b2b /share/www/script/test
parent3880ad954c47e8f05224f768159822b453a35e1f (diff)
GET /db/_design/doc/_info should not trigger an update.
Closes COUCHDB-858. Patch by Klaus Trainer. Thanks Klaus. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@1027215 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test')
-rw-r--r--share/www/script/test/design_docs.js32
1 files changed, 27 insertions, 5 deletions
diff --git a/share/www/script/test/design_docs.js b/share/www/script/test/design_docs.js
index 62606341..5faaad15 100644
--- a/share/www/script/test/design_docs.js
+++ b/share/www/script/test/design_docs.js
@@ -104,15 +104,37 @@ function() {
T(xhr.status == 200);
TEquals("javascript", JSON.parse(xhr.responseText).language);
+ var prev_view_sig = db.designInfo("_design/test").view_index.signature;
+
+ db.bulkSave(makeDocs(1, numDocs + 1));
+
// test that we get design doc info back
var dinfo = db.designInfo("_design/test");
TEquals("test", dinfo.name);
var vinfo = dinfo.view_index;
TEquals(51, vinfo.disk_size);
TEquals(false, vinfo.compact_running);
- TEquals("dc3264b45b74cc6d94666e3043e07154", vinfo.signature, 'ddoc sig');
+ // test that GET /db/_design/test/_info
+ // hasn't triggered an update of the views
+ TEquals(prev_view_sig, vinfo.signature, 'ddoc sig');
+ for (var loop = 0; loop < 2; loop++) {
+ T(db.view("test/all_docs_twice", {stale: "ok"}).total_rows === 0);
+ T(db.view("test/single_doc", {stale: "ok"}).total_rows === 0);
+ T(db.view("test/summate", {stale: "ok"}).rows.length === 0);
+ T(db.ensureFullCommit().ok);
+ restartServer();
+ };
- db.bulkSave(makeDocs(1, numDocs + 1));
+ // test that POST /db/_view_cleanup
+ // doesn't trigger an update of the views
+ T(db.viewCleanup().ok);
+ for (var loop = 0; loop < 2; loop++) {
+ T(db.view("test/all_docs_twice", {stale: "ok"}).total_rows == 0);
+ T(db.view("test/single_doc", {stale: "ok"}).total_rows == 0);
+ T(db.view("test/summate", {stale: "ok"}).rows.length == 0);
+ T(db.ensureFullCommit().ok);
+ restartServer();
+ };
// test commonjs in map functions
resp = db.view("test/commonjs", {limit:1});
@@ -127,9 +149,9 @@ function() {
for (var i = 0; i < numDocs; i++) {
T(rows[2*i].key == i+1);
T(rows[(2*i)+1].key == i+1);
- }
- T(db.view("test/no_docs").total_rows == 0)
- T(db.view("test/single_doc").total_rows == 1)
+ };
+ T(db.view("test/no_docs").total_rows == 0);
+ T(db.view("test/single_doc").total_rows == 1);
T(db.ensureFullCommit().ok);
restartServer();
};