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

Commit 7e416a52 by Sascha Depold

fixed tests for invalid credentials

1 parent 81f8389c
Showing with 13 additions and 16 deletions
...@@ -375,25 +375,22 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () { ...@@ -375,25 +375,22 @@ describe(Support.getTestDialectTeaser("Sequelize"), function () {
}) })
}) })
it("fails with incorrect database credentials", function(done) { if (dialect !== "sqlite") {
// sqlite doesn't have a concept of database credentials it("fails with incorrect database credentials", function(done) {
if (dialect === "sqlite") { this.sequelizeWithInvalidCredentials = new Sequelize("omg", "bar", null, this.sequelize.options)
expect(true).to.be.true
return done()
}
var sequelize2 = Support.getSequelizeInstance('foo', 'bar', null, { logging: false }) var User2 = this.sequelizeWithInvalidCredentials.define('User', { name: DataTypes.STRING, bio: DataTypes.TEXT })
, User2 = sequelize2.define('User', { name: DataTypes.STRING, bio: DataTypes.TEXT })
User2.sync().error(function(err) { User2.sync().complete(function(err) {
if (dialect === "postgres" || dialect === "postgres-native") { if (dialect === "postgres" || dialect === "postgres-native") {
expect(err.message).to.equal('role "bar" does not exist') expect(err.message).to.match(/(role "bar" does not exist)|(password authentication failed for user "bar")/)
} else { } else {
expect(err.message.toString()).to.match(/.*Access\ denied.*/) expect(err.message.toString()).to.match(/.*Access\ denied.*/)
} }
done() done()
})
}) })
}) }
}) })
describe('drop should work', function() { describe('drop should work', function() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!