Commit 80e8165a authored by Tristan Cavelier's avatar Tristan Cavelier

unordered alldocs response on local & revision tests fixed

parent 995cd4a3
...@@ -1150,8 +1150,14 @@ test ("AllDocs", function(){ ...@@ -1150,8 +1150,14 @@ test ("AllDocs", function(){
}; };
// alldocs // alldocs
o.spy(o, "value", o.allDocsResponse, "All docs"); o.spy(o, "value", o.allDocsResponse, "All docs");
o.jio.allDocs(o.f); o.jio.allDocs(function (err, response) {
o.clock.tick(1000); if (response && response.rows) {
response.rows.sort(function (a, b) {
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
}
o.f(err, response);
});
o.tick(o); o.tick(o);
// include docs // include docs
...@@ -1169,7 +1175,14 @@ test ("AllDocs", function(){ ...@@ -1169,7 +1175,14 @@ test ("AllDocs", function(){
// alldocs // alldocs
o.spy(o, "value", o.allDocsResponse, "All docs (include docs)"); o.spy(o, "value", o.allDocsResponse, "All docs (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 ? 1 : a.id < b.id ? -1 : 0;
});
}
o.f(err, response);
});
o.tick(o); o.tick(o);
// complex queries // complex queries
...@@ -1224,7 +1237,14 @@ test ("AllDocs", function(){ ...@@ -1224,7 +1237,14 @@ test ("AllDocs", function(){
}, },
"wildcard_character":'%' "wildcard_character":'%'
} }
}, o.f); }, function (err, response) {
if (response && response.rows) {
response.rows.sort(function (a, b) {
return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
});
}
o.f(err, response);
});
o.tick(o); o.tick(o);
o.jio.stop(); o.jio.stop();
...@@ -2284,7 +2304,7 @@ test("allDocs", function () { ...@@ -2284,7 +2304,7 @@ test("allDocs", function () {
o.jio.allDocs(function (err, response) { o.jio.allDocs(function (err, response) {
if (response && response.rows) { if (response && response.rows) {
response.rows.sort(function (a, b) { response.rows.sort(function (a, b) {
return a.id > b.id; return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
}) })
} }
o.f(err, response); o.f(err, response);
...@@ -2321,7 +2341,7 @@ test("allDocs", function () { ...@@ -2321,7 +2341,7 @@ test("allDocs", function () {
o.jio.allDocs({"include_docs": true}, function (err, response) { o.jio.allDocs({"include_docs": true}, function (err, response) {
if (response && response.rows) { if (response && response.rows) {
response.rows.sort(function (a, b) { response.rows.sort(function (a, b) {
return a.id > b.id; return a.id > b.id ? 1 : a.id < b.id ? -1 : 0;
}) })
} }
o.f(err, response); o.f(err, response);
......
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