(#3345) - correctly report auto_compaction in info()
diff --git a/lib/adapter.js b/lib/adapter.js index 532618c..b301456 100644 --- a/lib/adapter.js +++ b/lib/adapter.js
@@ -703,7 +703,7 @@ } // assume we know better than the adapter, unless it informs us info.db_name = info.db_name || self._db_name; - info.auto_compaction = !!(self._auto_compaction && self.type() !== 'http'); + info.auto_compaction = !!(self.auto_compaction && self.type() !== 'http'); callback(null, info); }); });
diff --git a/tests/integration/test.basics.js b/tests/integration/test.basics.js index 7277b6e..968c23f 100644 --- a/tests/integration/test.basics.js +++ b/tests/integration/test.basics.js
@@ -776,24 +776,19 @@ }); }); - it('db.info should give auto_compaction = false (#2744)', function (done) { + it('db.info should give auto_compaction = false (#2744)', function () { var db = new PouchDB(dbs.name, { auto_compaction: false}); - db.info().then(function (info) { + return db.info().then(function (info) { info.auto_compaction.should.equal(false); - done(); }); }); - it('db.info should give auto_compaction = true (#2744)', function (done) { - if (dbs.name === 'test.basics.js-local') { - var db = new PouchDB(dbs.name, { auto_compaction: true}); - db.info().then(function (info) { - info.auto_compaction.should.equal(true); - done(); - }); - } else { - done(); - } + it('db.info should give auto_compaction = true (#2744)', function () { + var db = new PouchDB(dbs.name, { auto_compaction: true}); + return db.info().then(function (info) { + // http doesn't support auto compaction + info.auto_compaction.should.equal(db.type() !== 'http'); + }); }); it('db.info should give correct doc_count', function (done) {