summaryrefslogtreecommitdiff
path: root/share/www/script
diff options
context:
space:
mode:
authorPaul Joseph Davis <davisp@apache.org>2009-04-27 19:41:23 +0000
committerPaul Joseph Davis <davisp@apache.org>2009-04-27 19:41:23 +0000
commitb97ea7c6b7c52430393ec7107674ba23ff57b9d5 (patch)
tree41591439b98ef9c2a91a8a4ef5e4c065b5001287 /share/www/script
parentf5d752a3c5f1c05962a7b693b54636967bfa7a5d (diff)
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
Diffstat (limited to 'share/www/script')
-rw-r--r--share/www/script/test/invalid_docids.js10
1 files changed, 10 insertions, 0 deletions
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"});