Removed unused callback in before hook in test and added proper configuration from user database config

This commit is contained in:
Daniel García Aubert 2016-01-14 14:08:34 +01:00
parent c308551d05
commit a89e3776ec
7 changed files with 10 additions and 16 deletions

View File

@ -21,15 +21,15 @@ UserDatabaseMetadataService.prototype.getUserMetadata = function (username, call
UserDatabaseMetadataService.prototype.parseMetadataToDatabase = function (userDatabaseMetadata) {
var dbParams = userDatabaseMetadata;
var dbopts = {
port: global.settings.db_batch_port || 6432,
pass: global.settings.db_pubuser_pass
};
var dbopts = {};
dbopts.pass = dbParams.dbpass || global.settings.db_pubuser_pass;
dbopts.port = dbParams.dbport || global.settings.db_batch_port || global.settings.db_port;
dbopts.host = dbParams.dbhost;
dbopts.dbname = dbParams.dbname;
dbopts.user = (!!dbParams.dbpublicuser) ? dbParams.dbpublicuser : global.settings.db_pubuser;
// batch is secure so it's going to be authenticated by default
dbopts.authenticated = true;
dbopts.user = _.template(global.settings.db_user, { user_id: dbParams.dbuser });

View File

@ -30,9 +30,8 @@ describe('Use case 1: cancel and modify a done job', function () {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {

View File

@ -30,9 +30,8 @@ describe('Use case 2: cancel a running job', function() {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {

View File

@ -30,9 +30,8 @@ describe('Use case 3: cancel a pending job', function() {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {

View File

@ -30,9 +30,8 @@ describe('Use case 4: modify a pending job', function() {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {

View File

@ -30,9 +30,8 @@ describe('Use case 5: modify a running job', function() {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {

View File

@ -30,9 +30,8 @@ describe('Use case 6: modify a done job', function() {
var batch = batchFactory(metadataBackend);
before(function (done) {
before(function () {
batch.start();
done();
});
after(function (done) {