Node.js based forum software built for the modern web
suggest topic test
Barış Soner Uşaklı4684ab3bf6dc
diff --git a/test/topics.js b/test/topics.jsindex e98a03a270..4dec7a37c4 100644--- a/test/topics.js+++ b/test/topics.js@@ -979,7 +979,7 @@ describe('Topic\'s', function () {describe('suggested topics', function () {var tid1;- var tid2;+ var tid3;before(function (done) {async.parallel({topic1: function (next) {@@ -988,10 +988,13 @@ describe('Topic\'s', function () {topic2: function (next) {topics.post({ uid: adminUid, tags: ['nodebb'], title: 'topic title 2', content: 'topic 2 content', cid: topic.categoryId }, next);},+ topic3: function (next) {+ topics.post({ uid: adminUid, tags: [], title: 'topic title 3', content: 'topic 3 content', cid: topic.categoryId }, next);+ },}, function (err, results) {assert.ifError(err);tid1 = results.topic1.topicData.tid;- tid2 = results.topic2.topicData.tid;+ tid3 = results.topic3.topicData.tid;done();});});@@ -1003,6 +1006,14 @@ describe('Topic\'s', function () {done();});});++ it('should return suggested topics', function (done) {+ topics.getSuggestedTopics(tid3, adminUid, 0, 2, function (err, topics) {+ assert.ifError(err);+ assert(Array.isArray(topics));+ done();+ });+ });});describe('unread', function () {