From 9032cfd7e12c5935982dd0c8b4e3d0be15c869fa Mon Sep 17 00:00:00 2001 From: Jan Lehnardt Date: Tue, 10 Nov 2009 11:40:01 +0000 Subject: Add doc id validation when creating a new document with the standalone attachment API. Closes COUCHDB-565. git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@834436 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/test/attachments.js | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'share') diff --git a/share/www/script/test/attachments.js b/share/www/script/test/attachments.js index 1ed81ad8..36f5a5ad 100644 --- a/share/www/script/test/attachments.js +++ b/share/www/script/test/attachments.js @@ -237,4 +237,11 @@ couchTests.attachments= function(debug) { headers:{"Content-Type":"text/plain;charset=utf-8"} }); TEquals(201, xhr.status, "should send 201 Accepted"); + + // implicit doc creation allows creating docs with a reserved id. COUCHDB-565 + var xhr = CouchDB.request("PUT", "/test_suite_db/_nonexistant/attachment.txt", { + headers: {"Content-Type":"text/plain;charset=utf-8"}, + body: "THIS IS AN ATTACHMENT. BOOYA!" + }); + TEquals(400, xhr.status, "should return error code 400 Bad Request"); }; -- cgit v1.2.3