Merge pull request #459 from strongloop/feature/fix-test-date

Fix createdAt type so that it won't overflow SQL server int
This commit is contained in:
Raymond Feng 2015-02-20 12:08:07 -08:00
commit 4c99fbabba
1 changed files with 6 additions and 4 deletions

View File

@ -17,7 +17,7 @@ describe('manipulation', function () {
married: Boolean,
age: {type: Number, index: true},
dob: Date,
createdAt: {type: Number, default: Date.now}
createdAt: {type: Date, default: Date}
}, { forceId: true });
db.automigrate(done);
@ -208,11 +208,13 @@ describe('manipulation', function () {
Person.findById(created.id, function(err, found) {
if (err) return done(err);
found.toObject().should.have.properties({
var result = found.toObject();
result.should.have.properties({
id: created.id,
name: 'a-name',
gender: undefined
name: 'a-name'
});
// The gender can be null from a RDB
should.equal(result.gender, null);
done();
});
});