Skip to content

Node.js based forum software built for the modern web

fix: #7037

Baris Usaklib86f15569034
diff --git a/src/controllers/helpers.js b/src/controllers/helpers.js
index 7668493337..5eef187cf8 100644
--- a/src/controllers/helpers.js
+++ b/src/controllers/helpers.js
@@ -166,7 +166,7 @@ helpers.buildCategoryBreadcrumbs = function (cid, callback) {
if (!data.disabled && !data.isSection) {
breadcrumbs.unshift({
- text: validator.escape(String(data.name)),
+ text: String(data.name),
url: nconf.get('relative_path') + '/category/' + data.slug,
});
}
diff --git a/test/categories.js b/test/categories.js
index c608eca3d5..805309572e 100644
--- a/test/categories.js
+++ b/test/categories.js
@@ -37,7 +37,7 @@ describe('Categories', function () {
it('should create a new category', function (done) {
Categories.create({
- name: 'Test Category',
+ name: 'Test Category & NodeBB',
description: 'Test category created by testing script',
icon: 'fa-check',
blockclass: 'category-blue',
@@ -60,7 +60,8 @@ describe('Categories', function () {
assert.equal(err, null);
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.strictEqual(categoryObj.disabled, 0);
@@ -70,9 +71,10 @@ describe('Categories', function () {
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.equal(response.statusCode, 200);
+ assert.equal(body.name, 'Test Category & NodeBB');
assert(body);
done();
});