From 65cf7a01ec3cc242707aa822fecfdd160392402c Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 2 Mar 2017 16:29:17 +0300 Subject: [PATCH] test for recent posts, fix redirect test --- test/controllers.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/test/controllers.js b/test/controllers.js index d79235d16f..1cd9f17eda 100644 --- a/test/controllers.js +++ b/test/controllers.js @@ -532,6 +532,15 @@ describe('Controllers', function () { }); }); + it('should get recent posts', function (done) { + request(nconf.get('url') + '/api/recent/posts/month', function (err, res, body) { + assert.ifError(err); + assert.equal(res.statusCode, 200); + assert(body); + done(); + }); + }); + it('should get post data', function (done) { request(nconf.get('url') + '/api/post/pid/' + pid, function (err, res, body) { assert.ifError(err); @@ -943,7 +952,7 @@ describe('Controllers', function () { describe('post redirect', function () { it('should 404 for invalid pid', function (done) { - request(nconf.get('url') + '/post/fail', function (err, res) { + request(nconf.get('url') + '/api/post/fail', function (err, res) { assert.ifError(err); assert.equal(res.statusCode, 404); done();