diff options
author | Filipe David Borba Manana <fdmanana@apache.org> | 2011-03-09 19:09:11 +0000 |
---|---|---|
committer | Filipe David Borba Manana <fdmanana@apache.org> | 2011-03-09 19:09:11 +0000 |
commit | 772fdde2eb970177438038a2479ec13385372cf5 (patch) | |
tree | f193e46bb51a99a533bdb13506c8e5fe248f0103 /share/www/script/test/all_docs.js | |
parent | 0d09aa9f79680be83e9893882bded0f4d8ba8b8d (diff) |
Merged revision 1079939 from trunk
Parameter "include_docs" now honors parameter "conflicts"
When querying a map view, /db/_all_docs/ or /db/_changes/ with
"include_docs=true", if "conflicts=true" is given as well, the
documents will contain the conflicts list (if there are conflicting
revisions).
Closes COUCHDB-549.
git-svn-id: https://svn.apache.org/repos/asf/couchdb/branches/1.1.x@1079941 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/test/all_docs.js')
-rw-r--r-- | share/www/script/test/all_docs.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/share/www/script/test/all_docs.js b/share/www/script/test/all_docs.js index 4324e3bb..1d83aa95 100644 --- a/share/www/script/test/all_docs.js +++ b/share/www/script/test/all_docs.js @@ -105,20 +105,24 @@ couchTests.all_docs = function(debug) { var winRev = db.open("3"); - changes = db.changes({include_docs: true, style: "all_docs"}); + changes = db.changes({include_docs: true, conflicts: true, style: "all_docs"}); TEquals("3", changes.results[3].id); TEquals(3, changes.results[3].changes.length); TEquals(winRev._rev, changes.results[3].changes[0].rev); TEquals("3", changes.results[3].doc._id); TEquals(winRev._rev, changes.results[3].doc._rev); + TEquals(true, changes.results[3].doc._conflicts instanceof Array); + TEquals(2, changes.results[3].doc._conflicts.length); - rows = db.allDocs({include_docs: true}).rows; + rows = db.allDocs({include_docs: true, conflicts: true}).rows; TEquals(3, rows.length); TEquals("3", rows[2].key); TEquals("3", rows[2].id); TEquals(winRev._rev, rows[2].value.rev); TEquals(winRev._rev, rows[2].doc._rev); TEquals("3", rows[2].doc._id); + TEquals(true, rows[2].doc._conflicts instanceof Array); + TEquals(2, rows[2].doc._conflicts.length); // test the all docs collates sanely db.save({_id: "Z", foo: "Z"}); |