Skip to content

Commit

Permalink
Merge 5c1f354 into c36333a
Browse files Browse the repository at this point in the history
  • Loading branch information
willholley committed Aug 5, 2015
2 parents c36333a + 5c1f354 commit d483b3d
Showing 1 changed file with 20 additions and 16 deletions.
36 changes: 20 additions & 16 deletions tests/integration/test.http.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,22 +44,26 @@ describe('test.http.js', function () {
}
var db = new PouchDB(dbs.name);
db.bulkDocs({ docs: docs }, function (err, result) {
var callCount = 0;
var ajax = PouchDB.utils.ajax;
PouchDB.utils.ajax = function (opts) {
if (/_changes/.test(opts.url)) {
callCount++;
}
ajax.apply(this, arguments);
};
db.changes({
since: 100
}).on('change', function (change) {
}).on('complete', function (result) {
callCount.should.equal(1, 'One _changes call to complete changes');
PouchDB.utils.ajax = ajax;
done();
}).on('error', done);
db.info(function (err, info) {
var update_seq = info.update_seq;

var callCount = 0;
var ajax = PouchDB.utils.ajax;
PouchDB.utils.ajax = function (opts) {
if (/_changes/.test(opts.url)) {
callCount++;
}
ajax.apply(this, arguments);
};
db.changes({
since: update_seq
}).on('change', function (change) {
}).on('complete', function (result) {
callCount.should.equal(1, 'One _changes call to complete changes');
PouchDB.utils.ajax = ajax;
done();
}).on('error', done);
});
});
});

Expand Down

0 comments on commit d483b3d

Please sign in to comment.