Fix ModelDefinition toJSON bug
This commit is contained in:
parent
c3c2907248
commit
291e7b2c74
|
@ -265,7 +265,7 @@ ModelDefinition.prototype.toJSON = function (forceRebuild) {
|
||||||
this.json = null;
|
this.json = null;
|
||||||
}
|
}
|
||||||
if (this.json) {
|
if (this.json) {
|
||||||
return json;
|
return this.json;
|
||||||
}
|
}
|
||||||
var json = {
|
var json = {
|
||||||
name: this.name,
|
name: this.name,
|
||||||
|
|
|
@ -36,7 +36,9 @@ describe('ModelDefinition class', function () {
|
||||||
assert.equal(json.properties.approved.type, "Boolean");
|
assert.equal(json.properties.approved.type, "Boolean");
|
||||||
assert.equal(json.properties.joinedAt.type, "Date");
|
assert.equal(json.properties.joinedAt.type, "Date");
|
||||||
assert.equal(json.properties.age.type, "Number");
|
assert.equal(json.properties.age.type, "Number");
|
||||||
|
|
||||||
|
assert.deepEqual(User.toJSON(), json);
|
||||||
|
|
||||||
done();
|
done();
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue