This commit is contained in:
Baris Usakli
2018-11-30 14:25:45 -05:00
parent ba619c7ec8
commit b86f155690
2 changed files with 6 additions and 4 deletions

View File

@@ -166,7 +166,7 @@ helpers.buildCategoryBreadcrumbs = function (cid, callback) {
if (!data.disabled && !data.isSection) { if (!data.disabled && !data.isSection) {
breadcrumbs.unshift({ breadcrumbs.unshift({
text: validator.escape(String(data.name)), text: String(data.name),
url: nconf.get('relative_path') + '/category/' + data.slug, url: nconf.get('relative_path') + '/category/' + data.slug,
}); });
} }

View File

@@ -37,7 +37,7 @@ describe('Categories', function () {
it('should create a new category', function (done) { it('should create a new category', function (done) {
Categories.create({ Categories.create({
name: 'Test Category', name: 'Test Category & NodeBB',
description: 'Test category created by testing script', description: 'Test category created by testing script',
icon: 'fa-check', icon: 'fa-check',
blockclass: 'category-blue', blockclass: 'category-blue',
@@ -60,7 +60,8 @@ describe('Categories', function () {
assert.equal(err, null); assert.equal(err, null);
assert(categoryData); assert(categoryData);
assert.equal(categoryObj.name, categoryData.name); assert.equal('Test Category & NodeBB', categoryData.name);
console.log(categoryData)
assert.equal(categoryObj.description, categoryData.description); assert.equal(categoryObj.description, categoryData.description);
assert.strictEqual(categoryObj.disabled, 0); assert.strictEqual(categoryObj.disabled, 0);
@@ -70,9 +71,10 @@ describe('Categories', function () {
it('should load a category route', function (done) { it('should load a category route', function (done) {
request(nconf.get('url') + '/category/' + categoryObj.cid + '/test-category', function (err, response, body) { request(nconf.get('url') + '/api/category/' + categoryObj.cid + '/test-category', { json: true }, function (err, response, body) {
assert.ifError(err); assert.ifError(err);
assert.equal(response.statusCode, 200); assert.equal(response.statusCode, 200);
assert.equal(body.name, 'Test Category & NodeBB');
assert(body); assert(body);
done(); done();
}); });