couchdb-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jch...@apache.org
Subject svn commit: r722364 - /incubator/couchdb/trunk/share/www/script/couch_tests.js
Date Tue, 02 Dec 2008 03:37:25 GMT
Author: jchris
Date: Mon Dec  1 19:37:24 2008
New Revision: 722364

URL: http://svn.apache.org/viewvc?rev=722364&view=rev
Log:
test that non-authors can't delete docs

Modified:
    incubator/couchdb/trunk/share/www/script/couch_tests.js

Modified: incubator/couchdb/trunk/share/www/script/couch_tests.js
URL: http://svn.apache.org/viewvc/incubator/couchdb/trunk/share/www/script/couch_tests.js?rev=722364&r1=722363&r2=722364&view=diff
==============================================================================
--- incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] (original)
+++ incubator/couchdb/trunk/share/www/script/couch_tests.js [utf-8] Mon Dec  1 19:37:24 2008
@@ -2114,6 +2114,15 @@
         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 @@
   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)
   }



Mime
View raw message