Ghost/ghost/admin/tests/unit/transforms/facebook-url-user-test.js

24 lines
779 B
JavaScript
Raw Normal View History

/* jshint expr:true */
2016-11-24 01:50:57 +03:00
import {describe, it} from 'mocha';
import {expect} from 'chai';
2016-11-24 01:50:57 +03:00
import {setupTest} from 'ember-mocha';
2016-11-24 01:50:57 +03:00
describe('Unit: Transform: facebook-url-user', function() {
setupTest('transform:facebook-url-user', {});
it('deserializes facebook url', function () {
let transform = this.subject();
let serialized = 'testuser';
let result = transform.deserialize(serialized);
2016-11-24 01:50:57 +03:00
expect(result).to.equal('https://www.facebook.com/testuser');
});
2016-11-24 01:50:57 +03:00
it('serializes url to facebook username', function () {
let transform = this.subject();
let deserialized = 'https://www.facebook.com/testuser';
let result = transform.serialize(deserialized);
2016-11-24 01:50:57 +03:00
expect(result).to.equal('testuser');
});
});