不要怂,就是干,撸起袖子干!

Commit ff6b1ca9 by Clement Teule

Failing test for #5467

1 parent c04c5bac
Showing with 24 additions and 0 deletions
...@@ -71,5 +71,28 @@ describe(Support.getTestDialectTeaser('Instance'), function() { ...@@ -71,5 +71,28 @@ describe(Support.getTestDialectTeaser('Instance'), function() {
expect(instance.get('id')).not.to.be.undefined; expect(instance.get('id')).not.to.be.undefined;
expect(instance.get('id')).to.be.ok; expect(instance.get('id')).to.be.ok;
}); });
it('should populate undefined columns with default value', function () {
var Model = current.define('Model', {
number1: {
type: DataTypes.INTEGER,
defaultValue: 1
},
number2: {
type: DataTypes.INTEGER,
defaultValue: 2
}
})
, instance;
instance = Model.build({
number1: undefined
});
expect(instance.get('number1')).not.to.be.undefined;
expect(instance.get('number1')).to.equal(1);
expect(instance.get('number2')).not.to.be.undefined;
expect(instance.get('number2')).to.equal(2);
});
}); });
}); });
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!