Skip to content

Node.js based forum software built for the modern web

added delete purge test

barisusakli5d9373730aa8
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();
});