From 59d00f0de98e50d64ea53e197b6c8ccf765ad057 Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Wed, 4 Dec 2013 15:36:20 +0100 Subject: [PATCH] fix wrong api usage in outbox --- src/js/bo/outbox.js | 4 +++- test/new-unit/outbox-bo-test.js | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/bo/outbox.js b/src/js/bo/outbox.js index 25fe1f4..22a697e 100644 --- a/src/js/bo/outbox.js +++ b/src/js/bo/outbox.js @@ -222,7 +222,9 @@ define(function(require) { function sendEncrypted(email) { removeFromPendingMails(email); - self._emailDao.sendEncrypted(email, function(err) { + self._emailDao.sendEncrypted({ + email: email + }, function(err) { if (err) { self._outboxBusy = false; callback(err); diff --git a/test/new-unit/outbox-bo-test.js b/test/new-unit/outbox-bo-test.js index 2941dad..e7e3111 100644 --- a/test/new-unit/outbox-bo-test.js +++ b/test/new-unit/outbox-bo-test.js @@ -80,7 +80,9 @@ define(function(require) { dummyMails = [member, invited, notinvited]; emailDaoStub.list.yieldsAsync(null, dummyMails); - emailDaoStub.sendEncrypted.yieldsAsync(); + emailDaoStub.sendEncrypted.withArgs(sinon.match(function(opts) { + return typeof opts.email !== 'undefined' && opts.email.to.address === member.to.address; + })).yieldsAsync(); emailDaoStub.sendPlaintext.yieldsAsync(); devicestorageStub.removeList.yieldsAsync(); invitationDaoStub.check.withArgs(sinon.match(function(o) {