From c1b6b981be10a2ef942e6b06bfc56c67c0057dcb Mon Sep 17 00:00:00 2001 From: John Christopher Anderson Date: Tue, 2 Dec 2008 03:37:24 +0000 Subject: test that non-authors can't delete docs git-svn-id: https://svn.apache.org/repos/asf/incubator/couchdb/trunk@722364 13f79535-47bb-0310-9956-ffa450edef68 --- share/www/script/couch_tests.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'share') diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index 47519a02..64b12f6b 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -2114,6 +2114,15 @@ var tests = { doc.foo = 3; T(user2Db.save(doc).ok); + // Damien can't delete it + try { + userDb.deleteDoc(doc); + T(false && "Can't get here. Should have thrown an error 4"); + } catch (e) { + T(e.error == "unauthorized"); + T(userDb.last_req.status == 401); + } + // Now delete document T(user2Db.deleteDoc(doc).ok); }); @@ -2130,7 +2139,7 @@ function makeDocs(start, end, templateDoc) { for (var i = start; i < end; i++) { var newDoc = eval("(" + templateDocSrc + ")"); newDoc._id = (i).toString(); - newDoc.integer = i + newDoc.integer = i; newDoc.string = (i).toString(); docs.push(newDoc) } -- cgit v1.2.3