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

Commit 5610e7de by Sascha Depold

made test a bit more generic

1 parent a9b6d98c
Showing with 14 additions and 7 deletions
......@@ -39,6 +39,12 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
})
})
describe('getDialect', function() {
it('returns the defined dialect', function() {
expect(this.sequelize.getDialect()).to.equal(dialect)
})
})
describe('isDefined', function() {
it("returns false if the dao wasn't defined before", function() {
expect(this.sequelize.isDefined('Project')).to.be.false
......@@ -502,17 +508,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
, self = this
this.sequelize.query(sql, null, { plain: true, raw: true }).success(function(r1) {
expect(r1.connection_count).to.equal(2)
self.sequelize.transaction(function(t) {
self.sequelize.query(sql, null, { plain: true, raw: true, transaction: t}).success(function(r2) {
expect(r1.connection_count).to.equal(3)
expect(r2.connection_count).to.equal(r1.connection_count + 1)
t.commit()
})
}).done(function() {
self.sequelize.query(sql, null, { plain: true, raw: true, transaction: t}).success(function(r2) {
expect(r1.connection_count).to.equal(2)
done()
})
setTimeout(function() {
self.sequelize.query(sql, null, { plain: true, raw: true }).success(function(r3) {
expect(r3.connection_count).to.equal(r1.connection_count)
done()
})
}, 1000)
})
})
})
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!