Ghost/core/test/unit/helpers/encode_spec.js
Katharina Irrgang bfade9f50d Tests: Renamed unit/server_helpers to unit/helpers (#9145)
no issue

- nothing to explain 😁
2017-10-19 12:02:21 +01:00

16 lines
479 B
JavaScript

var should = require('should'), // jshint ignore:line
// 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);
});
});