2020-04-29 18:44:27 +03:00
|
|
|
const should = require('should');
|
2014-10-10 18:54:07 +04:00
|
|
|
|
2020-04-29 18:44:27 +03:00
|
|
|
// Stuff we are testing
|
|
|
|
const helpers = require('../../../core/frontend/helpers');
|
2014-10-10 18:54:07 +04:00
|
|
|
|
|
|
|
describe('{{encode}} helper', function () {
|
|
|
|
it('can escape URI', function () {
|
2020-04-29 18:44:27 +03:00
|
|
|
const uri = '$pecial!Charact3r(De[iver]y)Foo #Bar';
|
|
|
|
const expected = '%24pecial!Charact3r(De%5Biver%5Dy)Foo%20%23Bar';
|
|
|
|
const escaped = helpers.encode(uri);
|
2014-10-10 18:54:07 +04:00
|
|
|
|
|
|
|
should.exist(escaped);
|
|
|
|
String(escaped).should.equal(expected);
|
|
|
|
});
|
|
|
|
});
|