diff --git a/tests/database/keys.js b/tests/database/keys.js index 43a44e5753..36e5fe5989 100644 --- a/tests/database/keys.js +++ b/tests/database/keys.js @@ -7,6 +7,9 @@ var async = require('async'), describe('Key methods', function() { + beforeEach(function(done) { + db.set('testKey', 'testValue', done); + }); it('should set a key without error', function(done) { db.set('testKey', 'testValue', function(err) { @@ -56,11 +59,15 @@ describe('Key methods', function() { }); }); - it('should return false if key does not exist or was deleted', function(done) { - db.exists('testKey', function(err, exists) { + it('should return false if key was deleted', function(done) { + db.delete('testKey', function(err) { assert.equal(err, null); - assert.strictEqual(exists, false); - done(); + assert.equal(arguments.length, 1); + db.exists('testKey', function(err, exists) { + assert.equal(err, null); + assert.strictEqual(exists, false); + done(); + }); }); });