Unified mongo and email style
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
@@ -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 *() {
|
||||
|
||||
@@ -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 *() {
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user