summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2008-12-02 03:37:24 +0000
committerJohn Christopher Anderson <jchris@apache.org>2008-12-02 03:37:24 +0000
commitc1b6b981be10a2ef942e6b06bfc56c67c0057dcb (patch)
treec44f380754e3e9fab1392d7d34d821e3d1e0da06
parent6e1ed0a059a64e9dd09e064d158a593817b4a71b (diff)
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
-rw-r--r--share/www/script/couch_tests.js11
1 files changed, 10 insertions, 1 deletions
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)
}