From 35ff71c37d71546f29eb9aa2816cc61c282bb964 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Thu, 23 Feb 2017 23:05:51 +0300 Subject: [PATCH] more tests --- test/topics.js | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/topics.js b/test/topics.js index 1ade4de261..9f430c995a 100644 --- a/test/topics.js +++ b/test/topics.js @@ -182,12 +182,27 @@ describe('Topic\'s', function () { }); }); - describe('.getTopicData', function () { - it('should not receive errors', function (done) { - topics.getTopicData(newTopic.tid, done); + + it('should not receive errors', function (done) { + topics.getTopicData(newTopic.tid, done); + }); + + it('should get topic title by pid', function (done) { + topics.getTitleByPid(newPost.pid, function (err, title) { + assert.ifError(err); + assert.equal(title, topic.title); + done(); }); }); + it('should get topic data by pid', function (done) { + topics.getTopicDataByPid(newPost.pid, function (err, data) { + assert.ifError(err); + assert.equal(data.tid, newTopic.tid); + done(); + }); + }); + describe('.getTopicWithPosts', function () { it('should get a topic with posts and other data', function (done) { topics.getTopicData(newTopic.tid, function (err, topicData) {