mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 03:55:55 +01:00
@@ -688,20 +688,21 @@ describe('Controllers', function () {
|
||||
});
|
||||
|
||||
it('should return {} if there is no template or locations', function (done) {
|
||||
request(nconf.get('url') + '/api/users', { json: true }, function (err, res, body) {
|
||||
request(nconf.get('url') + '/api/widgets/render', { json: true }, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert(body);
|
||||
assert.equal(Object.keys(body.widgets), 0);
|
||||
assert.equal(Object.keys(body), 0);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
it('should render templates', function (done) {
|
||||
request(nconf.get('url') + '/api/categories', { json: true }, function (err, res, body) {
|
||||
var url = nconf.get('url') + '/api/widgets/render?template=categories.tpl&url=&isMobile=false&locations%5B%5D=sidebar&locations%5B%5D=footer&locations%5B%5D=header';
|
||||
request(url, { json: true }, function (err, res, body) {
|
||||
assert.ifError(err);
|
||||
assert.equal(res.statusCode, 200);
|
||||
assert(body.widgets && body.widgets.sidebar);
|
||||
assert(body);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user