summaryrefslogtreecommitdiff
path: root/share/www/script
diff options
context:
space:
mode:
authorJan Lehnardt <jan@apache.org>2010-02-24 04:15:58 +0000
committerJan Lehnardt <jan@apache.org>2010-02-24 04:15:58 +0000
commit0dd8f16e42f4f1d7206cc6d4c7e49b6cf420f725 (patch)
treeae6f796f543bc66bc2481550b6d078f6d99b7a95 /share/www/script
parent21bf95639695e0a3a8379ff2a03a0061246870b0 (diff)
Allow replication to be cancelled. Closes COUCHDB-664. Patch by Robert Newson.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@915664 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script')
-rw-r--r--share/www/script/test/replication.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/share/www/script/test/replication.js b/share/www/script/test/replication.js
index d3725a17..a5ed5110 100644
--- a/share/www/script/test/replication.js
+++ b/share/www/script/test/replication.js
@@ -302,7 +302,26 @@ couchTests.replication = function(debug) {
TEquals("test_suite_db_b", dbB.info().db_name,
"Target database should exist");
+ // continuous
+ var continuousResult = CouchDB.replicate(dbA.name, "test_suite_db_b", {
+ body: {"continuous": true}
+ });
+ T(continuousResult.ok)
+ T(continuousResult._local_id)
+ var cancelResult = CouchDB.replicate(dbA.name, "test_suite_db_b", {
+ body: {"cancel": true}
+ });
+ T(cancelResult.ok)
+ T(continuousResult._local_id == cancelResult._local_id)
+
+ try {
+ var cancelResult2 = CouchDB.replicate(dbA.name, "test_suite_db_b", {
+ body: {"cancel": true}
+ });
+ } catch (e) {
+ T(e.error == "not_found")
+ }
// test replication object option doc_ids
var dbA = new CouchDB("test_suite_rep_docs_db_a", {"X-Couch-Full-Commit":"false"});