diff options
author | Robert Newson <rnewson@apache.org> | 2010-11-10 18:52:31 +0000 |
---|---|---|
committer | Robert Newson <rnewson@apache.org> | 2010-11-10 18:52:31 +0000 |
commit | 3a3bb5e8697bc02bbfb793b700c51cdc1e59737e (patch) | |
tree | 439fcd739e952f7b3972d0cd93073b86184b1640 /share/www/script/test/security_validation.js | |
parent | 9902712bc739a12ae6e0de381341babd4a05c740 (diff) |
COUCHDB-945 - ensure validation funs are still applied after compaction.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.0.x@1033642 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/security_validation.js')
-rw-r--r-- | share/www/script/test/security_validation.js | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/share/www/script/test/security_validation.js b/share/www/script/test/security_validation.js index e0ab17d6..dd3b202e 100644 --- a/share/www/script/test/security_validation.js +++ b/share/www/script/test/security_validation.js @@ -136,13 +136,20 @@ couchTests.security_validation = function(debug) { doc.foo=2; T(userDb.save(doc).ok); - // Save a document that's missing an author field. - try { - userDb.save({foo:1}); - T(false && "Can't get here. Should have thrown an error 2"); - } catch (e) { - T(e.error == "forbidden"); - T(userDb.last_req.status == 403); + // Save a document that's missing an author field (before and after compaction) + for (var i=0; i<2; i++) { + try { + userDb.save({foo:1}); + T(false && "Can't get here. Should have thrown an error 2"); + } catch (e) { + T(e.error == "forbidden"); + T(userDb.last_req.status == 403); + } + // compact. + T(db.compact().ok); + T(db.last_req.status == 202); + // compaction isn't instantaneous, loop until done + while (db.info().compact_running) {}; } // Now attempt to update the document as a different user, Jan |