mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 01:03:23 +03:00
a85f5fae35
no issue - fix lint errors in lib/gh-koenig - fix ghost:base eslint errors - update ember plugin refs, remove ember-suave plugin refs - remove old jshint refs - add `lint:js` script - switch to `eslint-plugin-ghost` extending `plugin:ghost/ember`
25 lines
839 B
JavaScript
25 lines
839 B
JavaScript
import {describe, it} from 'mocha';
|
|
import {expect} from 'chai';
|
|
import {setupTest} from 'ember-mocha';
|
|
|
|
describe('Unit: Transform: json-string', function () {
|
|
setupTest('transform:json-string', {});
|
|
|
|
it('serialises an Object to a JSON String', function () {
|
|
let transform = this.subject();
|
|
let obj = {one: 'one', two: 'two'};
|
|
expect(transform.serialize(obj)).to.equal(JSON.stringify(obj));
|
|
});
|
|
|
|
it('deserialises a JSON String to an Object', function () {
|
|
let transform = this.subject();
|
|
let obj = {one: 'one', two: 'two'};
|
|
expect(transform.deserialize(JSON.stringify(obj))).to.deep.equal(obj);
|
|
});
|
|
|
|
it('handles deserializing a blank string', function () {
|
|
let transform = this.subject();
|
|
expect(transform.deserialize('')).to.equal(null);
|
|
});
|
|
});
|