From 9fe89f590e7c4c321085a3eb040f1b4745c832c9 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Tue, 1 Nov 2016 14:34:15 +0300 Subject: [PATCH] more admin controller tests --- test/controllers-admin.js | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/test/controllers-admin.js b/test/controllers-admin.js index 3a8d151282..8f10c6ad95 100644 --- a/test/controllers-admin.js +++ b/test/controllers-admin.js @@ -126,6 +126,40 @@ describe('Admin Controllers', function () { }); }); + it('should load /admin/general/homepage', function (done) { + request(nconf.get('url') + '/api/admin/general/homepage', {jar: jar, json: true}, function (err, res, body) { + assert.ifError(err); + assert.equal(res.statusCode, 200); + assert(body.routes); + done(); + }); + }); + + it('should load /admin/advanced/database', function (done) { + request(nconf.get('url') + '/api/admin/advanced/database', {jar: jar, json: true}, function (err, res, body) { + assert.ifError(err); + assert.equal(res.statusCode, 200); + + if (nconf.get('redis')) { + assert(body.redis); + } else if (nconf.get('mongo')) { + assert(body.mongo); + } + done(); + }); + }); + + it('should load /admin/extend/plugins', function (done) { + request(nconf.get('url') + '/api/admin/extend/plugins', {jar: jar, json: true}, function (err, res, body) { + assert.ifError(err); + assert(body.hasOwnProperty('installed')); + assert(body.hasOwnProperty('upgradeCount')); + assert(body.hasOwnProperty('download')); + assert(body.hasOwnProperty('incompatible')); + done(); + }); + }); + after(function (done) { db.emptydb(done); });