2016-05-16 21:16:40 +03:00
|
|
|
/* jshint expr:true */
|
2016-11-24 01:50:57 +03:00
|
|
|
import {describe, it} from 'mocha';
|
2017-05-29 21:50:03 +03:00
|
|
|
import {expect} from 'chai';
|
2016-11-24 01:50:57 +03:00
|
|
|
import {setupTest} from 'ember-mocha';
|
2016-05-16 21:16:40 +03:00
|
|
|
|
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-05-16 21:16:40 +03:00
|
|
|
|
2016-11-24 01:50:57 +03:00
|
|
|
expect(result).to.equal('https://www.facebook.com/testuser');
|
|
|
|
});
|
2016-05-16 21:16:40 +03:00
|
|
|
|
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-05-16 21:16:40 +03:00
|
|
|
|
2016-11-24 01:50:57 +03:00
|
|
|
expect(result).to.equal('testuser');
|
|
|
|
});
|
|
|
|
});
|