Skip to content

Commit

Permalink
maxRevisions method test
Browse files Browse the repository at this point in the history
  • Loading branch information
Konstantinos Christofilos committed May 4, 2016
1 parent 298d673 commit ff2e1b9
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions test/database-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,37 @@ function shouldQueryCouch(name) {
return promise;
},
"returns a 200": macros.status(200)
},
"getting database max revisions (GET)": {
topic: function(db) {
var promise = new(events.EventEmitter);
db.maxRevisions(function(e, res) {
promise.emit('success', res);
});
return promise;
},
"returns default value (1000)": function(res) {
assert.equal(res, 1000);
}
},
"setting database max revisions to 10 (PUT)": {
topic: function(db) {
var promise = new(events.EventEmitter);
db.maxRevisions(10, function(err, putResponse) {
db.maxRevisions(function(err1, getResponse) {
promise.emit('success', putResponse, getResponse);
/* Reset to default */
db.maxRevisions(1000, function(e, res) {});
});
});
return promise;
},
"returns true": function(err, putResponse) {
assert.isTrue(putResponse.ok);
},
"new value is assigned (10)": function(err, putResponse, getResponse) {
assert.equal(getResponse, 10);
}
}
}
}
Expand Down

0 comments on commit ff2e1b9

Please sign in to comment.