0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00
ghost/test/unit/helpers/encode.test.js
Hannah Wolfe 1bbaf65a22
Removed need for index.js in frontend/helpers
- The index.js file was actually loader code
- It was mainly used by the unit tests, which needed to be rewritten to get each helper individually
2021-10-04 16:46:01 +01:00

15 lines
472 B
JavaScript

const should = require('should');
// Stuff we are testing
const encode = require('../../../core/frontend/helpers/encode');
describe('{{encode}} helper', function () {
it('can escape URI', function () {
const uri = '$pecial!Charact3r(De[iver]y)Foo #Bar';
const expected = '%24pecial!Charact3r(De%5Biver%5Dy)Foo%20%23Bar';
const escaped = encode(uri);
should.exist(escaped);
String(escaped).should.equal(expected);
});
});