From 56063e82a2ad88a6c4125906d64a6de7e8a8b7ee Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Wed, 18 Mar 2009 12:15:17 +0000 Subject: remove MOVE requests as they can't sensibly be supported and COPY & DELETE does the same thing git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@755575 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/copy_move_doc.js | 25 ++++--------------------- 1 file changed, 4 insertions(+), 21 deletions(-) (limited to 'share') diff --git a/share/www/script/test/copy_move_doc.js b/share/www/script/test/copy_move_doc.js index 050f8113..1b3ab0f9 100644 --- a/share/www/script/test/copy_move_doc.js +++ b/share/www/script/test/copy_move_doc.js @@ -10,7 +10,7 @@ // License for the specific language governing permissions and limitations under // the License. -couchTests.copy_move_doc = function(debug) { +couchTests.copy_doc = function(debug) { var db = new CouchDB("test_suite_db"); db.deleteDb(); db.createDb(); @@ -25,36 +25,19 @@ couchTests.copy_move_doc = function(debug) { T(xhr.status == 201); T(db.open("doc_that_was_copied").v == 1); - // move a doc - - // test error condition - var xhr = CouchDB.request("MOVE", "/test_suite_db/doc_to_be_copied", { - headers: {"Destination":"doc_that_was_moved"} - }); - T(xhr.status == 400); // bad request, MOVE requires source rev. - - var rev = db.open("doc_to_be_copied")._rev; - var xhr = CouchDB.request("MOVE", "/test_suite_db/doc_to_be_copied?rev=" + rev, { - headers: {"Destination":"doc_that_was_moved"} - }); - - T(xhr.status == 201); - T(db.open("doc_that_was_moved").v == 1); - T(db.open("doc_to_be_copied") == null); - // COPY with existing target - T(db.save({_id:"doc_to_be_copied",v:1}).ok); + T(db.save({_id:"doc_to_be_copied2",v:1}).ok); var doc = db.save({_id:"doc_to_be_overwritten",v:2}); T(doc.ok); // error condition - var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied", { + var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", { headers: {"Destination":"doc_to_be_overwritten"} }); T(xhr.status == 409); // conflict var rev = db.open("doc_to_be_overwritten")._rev; - var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied", { + var xhr = CouchDB.request("COPY", "/test_suite_db/doc_to_be_copied2", { headers: {"Destination":"doc_to_be_overwritten?rev=" + rev} }); T(xhr.status == 201); -- cgit v1.2.3