From 834ca016ecef9671fc9b5ab32f2c250aa5b3eccf Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 12 Nov 2014 14:34:02 -0500 Subject: [PATCH] topics.reply test --- tests/topics.js | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/topics.js b/tests/topics.js index 840a73bb50..9ca300d470 100644 --- a/tests/topics.js +++ b/tests/topics.js @@ -81,6 +81,28 @@ describe('Topic\'s', function() { }); }); + describe('.reply', function() { + var newTopic; + var newPost; + + before(function(done) { + topics.post({uid: topic.userId, title: topic.title, content: topic.content, cid: topic.categoryId}, function(err, result) { + newTopic = result.topicData; + newPost = result.postData; + done(); + }); + }); + + it('should create a new reply with proper parameters', function(done) { + topics.reply({uid: topic.userId, content: 'test post', tid: newTopic.tid}, function(err, result) { + assert.equal(err, null, 'was created with error'); + assert.ok(result); + + done(); + }); + }); + }); + describe('Get methods', function() { var newTopic; var newPost;