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

Commit 8d13b444 by Sascha Gehlich

Used the wrong `sequelize` in tests

1 parent 8fba28b0
Showing with 12 additions and 16 deletions
......@@ -656,27 +656,23 @@ describe(Support.getTestDialectTeaser("HasMany"), function() {
describe('addAssociations', function() {
it('supports transactions', function(done) {
var self = this
Support.prepareTransactionTest(this.sequelize, function(sequelize) {
var User = self.sequelize.define('User', { username: DataTypes.STRING })
, Task = self.sequelize.define('Task', { title: DataTypes.STRING })
var User = sequelize.define('User', { username: DataTypes.STRING })
, Task = sequelize.define('Task', { title: DataTypes.STRING })
User.hasMany(Task)
Task.hasMany(User)
User.sync({ force: true }).success(function() {
Task.sync({ force: true }).success(function() {
User.create({ username: 'foo' }).success(function(user) {
Task.create({ title: 'task' }).success(function(task) {
self.sequelize.transaction(function(t){
task.addUser(user, { transaction: t }).success(function() {
task.hasUser(user).success(function(hasUser) {
expect(hasUser).to.be.false
task.hasUser(user, { transaction: t }).success(function(hasUser) {
expect(hasUser).to.be.true
t.rollback().success(function() { done() })
})
sequelize.sync({ force: true }).success(function() {
User.create({ username: 'foo' }).success(function(user) {
Task.create({ title: 'task' }).success(function(task) {
sequelize.transaction(function(t){
task.addUser(user, { transaction: t }).success(function() {
task.hasUser(user).success(function(hasUser) {
expect(hasUser).to.be.false
task.hasUser(user, { transaction: t }).success(function(hasUser) {
expect(hasUser).to.be.true
t.rollback().success(function() { done() })
})
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!