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

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 () { ...@@ -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() { describe('isDefined', function() {
it("returns false if the dao wasn't defined before", function() { it("returns false if the dao wasn't defined before", function() {
expect(this.sequelize.isDefined('Project')).to.be.false expect(this.sequelize.isDefined('Project')).to.be.false
...@@ -502,17 +508,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () { ...@@ -502,17 +508,18 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
, self = this , self = this
this.sequelize.query(sql, null, { plain: true, raw: true }).success(function(r1) { 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.transaction(function(t) {
self.sequelize.query(sql, null, { plain: true, raw: true, transaction: t}).success(function(r2) { 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() { }).done(function() {
self.sequelize.query(sql, null, { plain: true, raw: true, transaction: t}).success(function(r2) { setTimeout(function() {
expect(r1.connection_count).to.equal(2) self.sequelize.query(sql, null, { plain: true, raw: true }).success(function(r3) {
done() 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!