Permalink
Browse files

Merge pull request #4 from /issues/3-response-document

fixes document responses for load/save #3
  • Loading branch information...
Zoddy committed Jun 4, 2013
2 parents 9273960 + e31e325 commit c00875cfa9c1d3e5f82fa021a7529e79cdc37987
Showing with 4 additions and 0 deletions.
  1. +2 −0 document.js
  2. +2 −0 test/3-document-test.js
View
@@ -442,6 +442,8 @@ Document.prototype._saveContent = function(body) {
for (key in body) {
if (key === '_rev') {
this._revision = body[key];
} else if (key === '_id') {
this._id = body[key];
} else {
this._body[key] = body[key];
}
View
@@ -40,6 +40,8 @@ exports.tests = [{
'url': ['PUT', config.database + '/' + config.document, {}],
'callback': function(error, document) {
expect(document).to.be.an('object').and.to.have.property('_id');
expect(document._body).to.be.an('object').and.to.not.have.property('_id');
expect(document._body).to.be.an('object').and.to.not.have.property('_rev');
},
}, {
'message': 'load document',

0 comments on commit c00875c

Please sign in to comment.