From dc59febb8d1708c34eff0b93772df8dff045a46b Mon Sep 17 00:00:00 2001 From: Felix Hammerl Date: Mon, 24 Feb 2014 17:37:23 +0100 Subject: [PATCH] remove angular properties from mail dto --- test/new-unit/email-dao-test.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/test/new-unit/email-dao-test.js b/test/new-unit/email-dao-test.js index 3de97ea..f03bd10 100644 --- a/test/new-unit/email-dao-test.js +++ b/test/new-unit/email-dao-test.js @@ -1028,10 +1028,13 @@ define(function(require) { uid: uid }).yieldsAsync(null, [message]); - localStoreStub = sinon.stub(dao, '_localStoreMessages').withArgs({ - folder: folder, - emails: [message] - }).yieldsAsync(); + localStoreStub = sinon.stub(dao, '_localStoreMessages').withArgs(sinon.match(function(o){ + expect(o.folder).to.equal(folder); + expect(o.emails[0].uid).to.equal(uid); + expect(o.emails[0].body).to.equal(body); + + return true; + })).yieldsAsync(); imapStreamStub = sinon.stub(dao, '_imapStreamText', function(opts, cb) { expect(opts).to.deep.equal({ @@ -1079,10 +1082,13 @@ define(function(require) { uid: uid }).yieldsAsync(null, [message]); - localStoreStub = sinon.stub(dao, '_localStoreMessages').withArgs({ - folder: folder, - emails: [message] - }).yieldsAsync(); + localStoreStub = sinon.stub(dao, '_localStoreMessages').withArgs(sinon.match(function(o){ + expect(o.folder).to.equal(folder); + expect(o.emails[0].uid).to.equal(uid); + expect(o.emails[0].body).to.equal(body); + + return true; + })).yieldsAsync(); imapStreamStub = sinon.stub(dao, '_imapStreamText', function(opts, cb) { expect(opts).to.deep.equal({