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

Commit 58a74fe9 by Jan Aagaard Meier

Merge pull request #1021 from durango/testenumsync

Added a special test for syncing an enum table multiple times.
2 parents ef0b12c9 baff9af1
Showing with 35 additions and 0 deletions
......@@ -949,6 +949,41 @@ describe(Support.getTestDialectTeaser("DAOFactory"), function () {
})
})
})
describe('can safely sync multiple times', function(done) {
it('through the factory', function(done) {
var Enum = this.sequelize.define('Enum', {
state: {
type: Sequelize.ENUM,
values: ['happy', 'sad'],
allowNull: true
}
})
Enum.sync({ force: true }).success(function() {
Enum.sync().success(function() {
Enum.sync({ force: true }).complete(done)
})
})
})
it('through sequelize', function(done) {
var self = this
, 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!