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

Commit baff9af1 by Daniel Durante

Added a special test for sequelize.sync and enums.

1 parent 3ee09569
Showing with 29 additions and 10 deletions
...@@ -950,18 +950,37 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () { ...@@ -950,18 +950,37 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
}) })
}) })
it('can safely sync multiple times', function(done) { describe('can safely sync multiple times', function(done) {
var Enum = this.sequelize.define('Enum', { it('through the factory', function(done) {
state: { var Enum = this.sequelize.define('Enum', {
type: Sequelize.ENUM, state: {
values: ['happy', 'sad'], type: Sequelize.ENUM,
allowNull: true values: ['happy', 'sad'],
} allowNull: true
}
})
Enum.sync({ force: true }).success(function() {
Enum.sync().success(function() {
Enum.sync({ force: true }).complete(done)
})
})
}) })
Enum.sync({ force: true }).success(function() { it('through sequelize', function(done) {
Enum.sync().success(function() { var self = this
Enum.sync({ force: true }).complete(done) , Enum = this.sequelize.define('Enum', {
state: {
type: Sequelize.ENUM,
values: ['happy', 'sad'],
allowNull: true
}
})
this.sequelize.sync({ force: true }).success(function() {
self.sequelize.sync().success(function() {
self.sequelize.sync({ force: true }).complete(done)
})
}) })
}) })
}) })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!