From ac2900a560c2c4288c4d91622cf3fd6db4959819 Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Thu, 5 Nov 2009 12:19:51 +0000 Subject: add safety net for code accidents where the document id in a doc delete request got missing accidentally git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@833036 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/basics.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share/www') diff --git a/share/www/script/test/basics.js b/share/www/script/test/basics.js index a261b5ae..7e0fe0d6 100644 --- a/share/www/script/test/basics.js +++ b/share/www/script/test/basics.js @@ -235,4 +235,11 @@ couchTests.basics = function(debug) { result = JSON.parse(xhr.responseText); T(result.error == "bad_request"); T(result.reason == "`keys` member must be a array."); + + // oops, the doc id got lost in code nirwana + xhr = CouchDB.request("DELETE", "/test_suite_db/?rev=foobarbaz"); + TEquals(400, xhr.status, "should return a bad request"); + result = JSON.parse(xhr.responseText); + TEquals("bad_request", result.error); + TEquals("You tried to DELETE a database with a ?=rev parameter. Did mean to DELETE a document instead?", result.reason); }; -- cgit v1.2.3