Ghost/core/test/unit/helpers/encode_spec.js
2018-06-02 21:48:23 +02:00

16 lines
457 B
JavaScript

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