Commit 68d63d5f authored by Tristan Cavelier's avatar Tristan Cavelier

localstorage allDocs returns attachments, fixed.

parent b1145bbb
......@@ -347,7 +347,7 @@ jIO.addStorageType('local', function (spec, my) {
*/
that.allDocs = function (command) {
var i, j, file, items = 0,
s = new RegExp(priv.localpath + '\\/.*$'),
s = new RegExp("^" + priv.localpath + "\\/[^/]+$"),
all_doc_response = {},
query_object = [], query_syntax, query_response = [];
......
......@@ -1118,6 +1118,16 @@ test ("AllDocs", function(){
o.fakeDoc.title = o.titles[i];
o.fakeDoc.year = o.years[i];
o.fakeDoc.author = o.director[i];
if (i === 5) {
o.fakeDoc._attachments = {
"att": {
"digest": "md5-dontcare",
"content_type": "text/plain",
"length": 3
}
};
localstorage.setItem(o.localpath + "/doc_05/att", "abc");
}
localstorage.setItem(o.localpath+"/doc_"+(i < 10 ? "0"+i : i), o.fakeDoc);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment