From 5d9373730aa8926b706197e1dfa63da3eb605654 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 25 Feb 2016 18:04:32 +0200 Subject: [PATCH] added delete purge test --- tests/topics.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/topics.js b/tests/topics.js index a32f0fd37c..bf30147573 100644 --- a/tests/topics.js +++ b/tests/topics.js @@ -162,6 +162,32 @@ describe('Topic\'s', function() { }); }); + describe('.purge/.delete', function() { + var newTopic; + + before(function(done) { + topics.post({uid: topic.userId, title: topic.title, content: topic.content, cid: topic.categoryId}, function(err, result) { + newTopic = result.topicData; + done(); + }); + }); + + it('should delete the topic', function(done) { + topics.delete(newTopic.tid, function(err) { + assert.ifError(err); + done(); + }); + }); + + it('should purge the topic', function(done) { + topics.purge(newTopic.tid, function(err) { + assert.ifError(err); + done(); + }); + }); + }); + + after(function() { db.flushdb(); });