Extract serializer logic into lib

To use the same code in hubot I extracted the serializer logic into lib to later move it into `truffle-kredits` when we are done with all other common logic.
This commit is contained in:
2018-04-06 18:35:21 +02:00
committed by Michael Bumann
parent 8f841522a3
commit b21d2ad864
6 changed files with 255 additions and 165 deletions
-16
View File
@@ -1,6 +1,4 @@
import { moduleFor, test } from 'ember-qunit';
import schemas from 'npm:kosmos-schemas';
import tv4 from 'npm:tv4';
moduleFor('model:contributor', 'Unit | Model | contributor');
@@ -10,17 +8,3 @@ test('#avatarURL() returns correct URL', function(assert) {
assert.equal(model.get('avatarURL'), 'https://avatars2.githubusercontent.com/u/318?v=3&s=128');
});
test('#toJSON() returns a valid JSON-LD representation of the model', function(assert) {
let model = this.subject();
model.setProperties({
name: 'Satoshi Nakamoto',
kind: 'person',
github_uid: 123,
github_username: 'therealsatoshi',
wiki_username: 'Satoshi',
});
assert.ok(tv4.validate(model.toJSON(), schemas['contributor']));
});