Unified mongo and email style

This commit is contained in:
Tankred Hase
2016-06-08 14:01:30 +02:00
parent 56162a01d9
commit b5fb5331fc
7 changed files with 17 additions and 32 deletions

View File

@@ -23,8 +23,8 @@ describe('Koa App (HTTP Server) Integration Tests', function() {
before(function *() {
publicKeyArmored = fs.readFileSync(__dirname + '/../key1.asc', 'utf8');
mongo = new Mongo(config.mongo);
yield mongo.connect();
mongo = new Mongo();
yield mongo.init(config.mongo);
sendEmailStub = sinon.stub().returns(Promise.resolve({ response:'250' }));
sendEmailStub.withArgs(sinon.match(recipient => {

View File

@@ -5,8 +5,6 @@ require('co-mocha')(require('mocha')); // monkey patch mocha for generators
const expect = require('chai').expect;
const config = require('config');
const Email = require('../../src/email/email');
const nodemailer = require('nodemailer');
const openpgpEncrypt = require('nodemailer-openpgp').openpgpEncrypt;
const tpl = require('../../src/email/templates.json');
describe('Email Integration Tests', function() {
@@ -22,7 +20,7 @@ describe('Email Integration Tests', function() {
protocol: 'http',
host: 'localhost:' + config.server.port
};
email = new Email(nodemailer, openpgpEncrypt);
email = new Email();
email.init(config.email);
});

View File

@@ -13,8 +13,8 @@ describe('Mongo Integration Tests', function() {
let mongo;
before(function *() {
mongo = new Mongo(config.mongo);
yield mongo.connect();
mongo = new Mongo();
yield mongo.init(config.mongo);
});
beforeEach(function *() {

View File

@@ -25,8 +25,8 @@ describe('Public Key Integration Tests', function() {
before(function *() {
publicKeyArmored = require('fs').readFileSync(__dirname + '/../key1.asc', 'utf8');
mongo = new Mongo(config.mongo);
yield mongo.connect();
mongo = new Mongo();
yield mongo.init(config.mongo);
});
beforeEach(function *() {

View File

@@ -15,8 +15,8 @@ describe('User ID Integration Tests', function() {
let mongo, userId, uid1, uid2;
before(function *() {
mongo = new Mongo(config.mongo);
yield mongo.connect();
mongo = new Mongo();
yield mongo.init(config.mongo);
userId = new UserId(mongo);
});