summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--share/www/script/couch_tests.js4
-rw-r--r--src/couchdb/couch_doc.erl2
2 files changed, 5 insertions, 1 deletions
diff --git a/share/www/script/couch_tests.js b/share/www/script/couch_tests.js
index a7844bdc..ccb9755d 100644
--- a/share/www/script/couch_tests.js
+++ b/share/www/script/couch_tests.js
@@ -54,6 +54,10 @@ var tests = {
var id = result.id; // save off the id for later
+ // make sure the revs_info status is good
+ var doc = db.open(id, {revs_info:true});
+ T(doc._revs_info[0].status == "available");
+
// Create some more documents.
// Notice the use of the ok member on the return result.
T(db.save({_id:"1",a:2,b:4}).ok);
diff --git a/src/couchdb/couch_doc.erl b/src/couchdb/couch_doc.erl
index 12b48dc2..3efb8bd7 100644
--- a/src/couchdb/couch_doc.erl
+++ b/src/couchdb/couch_doc.erl
@@ -39,7 +39,7 @@ to_json_obj(#doc{id=Id,deleted=Del,body=Body,revs=Revs,meta=Meta}=Doc,Options)->
lists:map(
fun({revs_info, RevsInfo}) ->
JsonRevsInfo =
- [{[{rev, Rev}, {status, atom_to_list(Status)}]} ||
+ [{[{rev, Rev}, {status, list_to_binary(atom_to_list(Status))}]} ||
{Rev, Status} <- RevsInfo],
{<<"_revs_info">>, JsonRevsInfo};
({conflicts, Conflicts}) ->