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

View File

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