From b97ea7c6b7c52430393ec7107674ba23ff57b9d5 Mon Sep 17 00:00:00 2001 From: Paul Joseph Davis Date: Mon, 27 Apr 2009 19:41:23 +0000 Subject: Resolves COUCHDB-332 Proper errors for invalid docids. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@769127 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/invalid_docids.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'share') diff --git a/share/www/script/test/invalid_docids.js b/share/www/script/test/invalid_docids.js index 814d1a21..4fc4bbf5 100644 --- a/share/www/script/test/invalid_docids.js +++ b/share/www/script/test/invalid_docids.js @@ -29,6 +29,16 @@ couchTests.invalid_docids = function(debug) { T(e.error == "bad_request"); } + // Via PUT with _id not in body. + var res = res = db.request("PUT", "/test_suite_db/_other", {"body": "{}"}); + T(res.status == 400); + T(JSON.parse(res.responseText).error == "bad_request"); + + // Accidental POST to form handling code. + res = db.request("POST", "/test_suite_db/_tmp_view", {"body": "{}"}); + T(res.status == 400); + T(JSON.parse(res.responseText).error == "bad_request"); + // Test invalid _prefix try { db.save({"_id": "_invalid"}); -- cgit v1.2.3