mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 03:14:03 +03:00
cf36851265
replaces #41, #60 - update ember-suave and grunt-jscs to 3.0 - standardize Ember global de-structuring rules across app & tests
37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
/* jshint expr:true */
|
|
import { expect } from 'chai';
|
|
import { describeModule, it } from 'ember-mocha';
|
|
import Ember from 'ember';
|
|
import SlackIntegration from 'ghost-admin/models/slack-integration';
|
|
|
|
const {
|
|
A: emberA
|
|
} = Ember;
|
|
|
|
describeModule(
|
|
'transform:slack-settings',
|
|
'Unit: Transform: slack-settings',
|
|
{},
|
|
function() {
|
|
it('deserializes settings json', function () {
|
|
let transform = this.subject();
|
|
let serialized = '[{"url":"http://myblog.com/blogpost1"}]';
|
|
let result = transform.deserialize(serialized);
|
|
|
|
expect(result.length).to.equal(1);
|
|
expect(result[0]).to.be.instanceof(SlackIntegration);
|
|
expect(result[0].get('url')).to.equal('http://myblog.com/blogpost1');
|
|
});
|
|
|
|
it('serializes array of Slack settings', function () {
|
|
let transform = this.subject();
|
|
let deserialized = emberA([
|
|
SlackIntegration.create({url: 'http://myblog.com/blogpost1'})
|
|
]);
|
|
let result = transform.serialize(deserialized);
|
|
|
|
expect(result).to.equal('[{"url":"http://myblog.com/blogpost1"}]');
|
|
});
|
|
}
|
|
);
|