Revert "widgets refactor"

This reverts commit 9e94edb5aa.
This commit is contained in:
Baris Usakli
2017-07-07 15:35:06 -04:00
parent 9e94edb5aa
commit e0de922ede
10 changed files with 130 additions and 133 deletions

View File

@@ -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();
});
});