Add credential extract unit tests

This commit is contained in:
Nick O'Leary
2015-03-13 21:26:50 +00:00
parent f77dd06e65
commit 731efe1c01
4 changed files with 128 additions and 162 deletions

View File

@@ -63,11 +63,9 @@ function registerEndpoint(type) {
module.exports = {
init: function (_storage) {
init: function (_storage,_app) {
storage = _storage;
// TODO: this should get passed in init function call rather than
// required directly.
redApp = require("../server").app;
redApp = _app;
},
/**
@@ -166,7 +164,6 @@ module.exports = {
var newCreds = node.credentials;
if (newCreds) {
var savedCredentials = credentialCache[nodeID] || {};
var dashedType = nodeType.replace(/\s+/g, '-');
var definition = credentialsDef[dashedType];
if (!definition) {

View File

@@ -50,8 +50,8 @@ function createNode(node,def) {
}
}
function init(_settings,storage) {
credentials.init(storage);
function init(_settings,storage,app) {
credentials.init(storage,app);
flows.init(storage);
registry.init(_settings);
}