Stop duplicating global.environment as global.settings

This commit is contained in:
Sandro Santilli 2014-03-28 18:47:59 +01:00
parent 5c1125900b
commit 312194228a
4 changed files with 4 additions and 8 deletions

3
app.js
View File

@ -24,10 +24,9 @@ if (ENV != 'development' && ENV != 'production' && ENV != 'staging' ){
var _ = require('underscore')
, Step = require('step')
;
// set environment specific variables
global.settings = require(__dirname + '/config/settings');
global.environment = require(__dirname + '/config/environments/' + ENV);
_.extend(global.settings, global.environment);
global.log4js = require('log4js')
log4js_config = {

View File

@ -1 +0,0 @@
module.exports.oneDay = 86400000;

View File

@ -889,8 +889,8 @@ suite('server', function() {
// See https://github.com/CartoDB/Windshaft-cartodb/issues/89
test("get'ing a tile with a user-specific database password", function(done){
var style = querystring.stringify({style: test_style_black_200, style_version: '2.0.0'});
var backupDBPass = global.settings.postgres_auth_pass;
global.settings.postgres_auth_pass = '<%= user_password %>';
var backupDBPass = global.environment.postgres_auth_pass;
global.environment.postgres_auth_pass = '<%= user_password %>';
Step (
function() {
var next = this;
@ -917,7 +917,7 @@ suite('server', function() {
return null
},
function finish(err) {
global.settings.postgres_auth_pass = backupDBPass;
global.environment.postgres_auth_pass = backupDBPass;
done(err);
}
);

View File

@ -10,9 +10,7 @@ var assert = require('assert');
var LZMA = require('lzma/lzma_worker.js').LZMA;
// set environment specific variables
global.settings = require(__dirname + '/../../config/settings');
global.environment = require(__dirname + '/../../config/environments/test');
_.extend(global.settings, global.environment);
process.env.NODE_ENV = 'test';