diff options
Diffstat (limited to 'share/www/script/couch_tests.js')
-rw-r--r-- | share/www/script/couch_tests.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js index 70879479..cf1a4865 100644 --- a/share/www/script/couch_tests.js +++ b/share/www/script/couch_tests.js @@ -849,6 +849,20 @@ var tests = { var docs = makeDocs(0, 10); var saveResult = db.bulkSave(docs); T(saveResult.ok); + + + var binAttDoc = { + _id:"bin_doc", + _attachments:{ + "foo.txt": { + "content-type":"text/plain", + "data": "VGhpcyBpcyBhIGJhc2U2NCBlbmNvZGVkIHRleHQ=" + } + } + } + + T(db.save(binAttDoc).ok); + var originalsize = db.info().disk_size; for(var i in docs) { @@ -862,6 +876,12 @@ var tests = { //compaction isn't instantaneous, loop until done while(db.info().compact_running) {}; + + + var xhr = CouchDB.request("GET", "/test_suite_db/bin_doc/foo.txt"); + T(xhr.responseText == "This is a base64 encoded text") + T(xhr.getResponseHeader("content-type") == "text/plain") + var compactedsize = db.info().disk_size; T(deletesize > originalsize); |