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

Commit 99e3183c by Jan Aagaard Meier

Merge pull request #932 from durango/defaultid

Added a test to ensure primary keys for postgres wouldn't necessarily be...
2 parents 1029e406 451a9c67
Showing with 18 additions and 1 deletions
......@@ -69,6 +69,23 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
done()
})
it('allows us us to predefine the ID column with our own specs', function(done) {
var User = this.sequelize.define('UserCol', {
id: {
type: Sequelize.STRING,
defaultValue: 'User',
primaryKey: true
}
})
User.sync({ force: true }).success(function() {
User.create({id: 'My own ID!'}).success(function(user) {
expect(user.id).to.equal('My own ID!')
done()
})
})
})
it("throws an error if 2 autoIncrements are passed", function(done) {
var self = this
expect(function() {
......@@ -382,7 +399,7 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
, pad = function (number) {
if (number > 9) {
return number
}
}
return '0' + number
}
expect(user.year).to.equal(now.getFullYear() + '-' + pad(now.getMonth() + 1) + '-' + pad(now.getDate()))
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!