2016-03-03 11:52:27 +03:00
|
|
|
/* jshint expr:true */
|
2016-11-14 16:16:51 +03:00
|
|
|
import {expect} from 'chai';
|
|
|
|
import {describeModule, it} from 'ember-mocha';
|
2016-03-03 11:52:27 +03:00
|
|
|
|
|
|
|
describeModule(
|
|
|
|
'transform:twitter-url-user',
|
|
|
|
'Unit: Transform: twitter-url-user',
|
2016-06-11 19:52:36 +03:00
|
|
|
{},
|
2016-03-03 11:52:27 +03:00
|
|
|
function() {
|
|
|
|
it('deserializes twitter url', function () {
|
|
|
|
let transform = this.subject();
|
|
|
|
let serialized = '@testuser';
|
|
|
|
let result = transform.deserialize(serialized);
|
|
|
|
|
|
|
|
expect(result).to.equal('https://twitter.com/testuser');
|
|
|
|
});
|
|
|
|
|
|
|
|
it('serializes url to twitter username', function () {
|
|
|
|
let transform = this.subject();
|
|
|
|
let deserialized = 'https://twitter.com/testuser';
|
|
|
|
let result = transform.serialize(deserialized);
|
|
|
|
|
|
|
|
expect(result).to.equal('@testuser');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
);
|