Commit 995cd4a3 authored by Tristan Cavelier's avatar Tristan Cavelier

unordered alldocs response on revision storage test fixed

parent abfd9f29
...@@ -2261,17 +2261,17 @@ test("allDocs", function () { ...@@ -2261,17 +2261,17 @@ test("allDocs", function () {
o.rows = { o.rows = {
"total_rows": 3, "rows": [{ "total_rows": 3, "rows": [{
"id": "no",
"key": "no",
"value": {
"rev": o.rev2
}
}, {
"id": "maybe", "id": "maybe",
"key": "maybe", "key": "maybe",
"value": { "value": {
"rev": o.rev3 "rev": o.rev3
} }
}, {
"id": "no",
"key": "no",
"value": {
"rev": o.rev2
}
}, { }, {
"id": "yes", "id": "yes",
"key": "yes", "key": "yes",
...@@ -2281,10 +2281,21 @@ test("allDocs", function () { ...@@ -2281,10 +2281,21 @@ test("allDocs", function () {
}] }]
}; };
o.spy(o, "value", o.rows, "allDocs"); o.spy(o, "value", o.rows, "allDocs");
o.jio.allDocs(o.f); o.jio.allDocs(function (err, response) {
if (response && response.rows) {
response.rows.sort(function (a, b) {
return a.id > b.id;
})
}
o.f(err, response);
});
o.tick(o); o.tick(o);
o.rows.rows[0].doc = { o.rows.rows[0].doc = {
"_id": "maybe",
"_rev": o.rev3
};
o.rows.rows[1].doc = {
"_id": "no", "_id": "no",
"_rev": o.rev2, "_rev": o.rev2,
"_attachments": { "_attachments": {
...@@ -2295,10 +2306,6 @@ test("allDocs", function () { ...@@ -2295,10 +2306,6 @@ test("allDocs", function () {
} }
}, },
}; };
o.rows.rows[1].doc = {
"_id": "maybe",
"_rev": o.rev3
};
o.rows.rows[2].doc = { o.rows.rows[2].doc = {
"_id": "yes", "_id": "yes",
"_rev": o.rev1, "_rev": o.rev1,
...@@ -2310,9 +2317,15 @@ test("allDocs", function () { ...@@ -2310,9 +2317,15 @@ test("allDocs", function () {
} }
}, },
}; };
o.rows.rows.unshift(o.rows.rows.pop());
o.spy(o, "value", o.rows, "allDocs + include docs"); o.spy(o, "value", o.rows, "allDocs + include docs");
o.jio.allDocs({"include_docs": true}, o.f); o.jio.allDocs({"include_docs": true}, function (err, response) {
if (response && response.rows) {
response.rows.sort(function (a, b) {
return a.id > b.id;
})
}
o.f(err, response);
});
o.tick(o); o.tick(o);
o.jio.stop(); o.jio.stop();
......
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