Unnecessary error on mongodb authentication. Skip checking

This commit is contained in:
Anatoliy Chakkaev 2012-08-17 22:48:14 +04:00
parent d2d602117f
commit 62178c26c9
2 changed files with 3 additions and 4 deletions

View File

@ -71,8 +71,7 @@ function MongoDB(s, schema, callback) {
if (err) throw err; if (err) throw err;
if (s.username && s.password) { if (s.username && s.password) {
t = this; t = this;
client.authenticate(s.username, s.password, function(err, result) { client.authenticate(s.username, s.password, function (err, result) {
if (err) throw err;
t.client = client; t.client = client;
schema.client = client; schema.client = client;
callback(); callback();
@ -231,4 +230,4 @@ MongoDB.prototype.updateAttributes = function updateAttrs(model, id, data, cb) {
MongoDB.prototype.disconnect = function () { MongoDB.prototype.disconnect = function () {
this.client.close(); this.client.close();
}; };

View File

@ -37,11 +37,11 @@ if (process.env.ONLY && !testPerformed) {
} }
function performTestFor(schemaName) { function performTestFor(schemaName) {
testPerformed = true;
context(schemaName, function () { context(schemaName, function () {
var schema = new Schema(schemaName, schemas[schemaName] || {}); var schema = new Schema(schemaName, schemas[schemaName] || {});
it('should connect to database', function (test) { it('should connect to database', function (test) {
testPerformed = true;
if (schema.connected) return test.done(); if (schema.connected) return test.done();
schema.on('connected', test.done); schema.on('connected', test.done);
}); });