From d14b3e37a2c0d647b59259bf2ca059b5817f144c Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 30 Jun 2016 21:58:48 +0200 Subject: Do not generate a random password for test env --- server/initializers/installer.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'server/initializers') diff --git a/server/initializers/installer.js b/server/initializers/installer.js index 53b07903c..059fcd8d8 100644 --- a/server/initializers/installer.js +++ b/server/initializers/installer.js @@ -81,7 +81,18 @@ function createOAuthUserIfNotExist (callback) { logger.info('Creating the administrator.') const username = 'root' - const password = passwordGenerator(8, true) + let password = '' + + // Do not generate a random password for tests + if (process.env.NODE_ENV === 'test') { + password = 'test' + + if (process.env.NODE_APP_INSTANCE) { + password += process.env.NODE_APP_INSTANCE + } + } else { + password = passwordGenerator(8, true) + } Users.createUser(username, password, function (err) { if (err) return callback(err) -- cgit v1.2.3