diff --git a/src/routes/debug.js b/src/routes/debug.js index 64be1bc49d..695e806b23 100644 --- a/src/routes/debug.js +++ b/src/routes/debug.js @@ -57,12 +57,6 @@ module.exports = function(app, middleware, controllers) { }); router.get('/test', function(req, res) { - //res.redirect(404); - var db = require('../database'); - db.increment('someDerpKey', function(err, value) { - console.log(err, value); - db.delete('someDerpKey'); - res.json('ok'); - }) + res.redirect(404); }); }; diff --git a/tests/database/sets.js b/tests/database/sets.js index b5e2cb6e8b..bdcd4fba30 100644 --- a/tests/database/sets.js +++ b/tests/database/sets.js @@ -139,6 +139,50 @@ describe('Set methods', function() { }); }); + describe('setRemove()', function() { + it('should remove a element from set', function(done) { + db.setRemove('testSet', '2', function(err) { + assert.equal(err, null); + assert.equal(arguments.length, 1, 'arguments.length error'); + + db.isSetMember('testSet', '2', function(err, isMember) { + assert.equal(err, null); + assert.equal(isMember, false); + done(); + }); + }); + }); + }); + + describe('setsRemove()', function() { + it('should remove a element from multiple sets', function(done) { + db.setsRemove(['set1', 'set2'], 'value', function(err) { + assert.equal(err, null); + assert.equal(arguments.length, 1, 'arguments.length error'); + db.isMemberOfSets(['set1', 'set2'], 'value', function(err, members) { + assert.equal(err, null); + assert.deepEqual(members, [false, false]); + done(); + }); + }); + }); + }); + + describe('setRemoveRandom()', function() { + it('should remove a random element from set', function(done) { + db.setRemoveRandom('testSet', function(err, element) { + assert.equal(err, null); + assert.equal(arguments.length, 2, 'arguments.length error'); + + db.isSetMember('testSet', element, function(err, ismember) { + assert.equal(err, null); + assert.equal(ismember, false); + done(); + }); + }); + }); + }); + after(function() { db.flushdb();