diff options
author | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-12-03 16:04:54 -0200 |
---|---|---|
committer | Alexandre Pretto Nunes <anunes@thoughtworks.com> | 2014-12-03 16:04:54 -0200 |
commit | 7594b311441ca0c0eee39b4e953c52645213ffc3 (patch) | |
tree | f3e0f5640abf68027172795ca9ffd054d3d5db53 /web-ui/test/spec/services/model/mail.spec.js | |
parent | f7472aed29c525bc630fe1ea05833f840bc42dc4 (diff) | |
parent | fada5155d78336ea4796e934520636472df17348 (diff) |
Merge pull request #166 from pixelated-project/fix_reply_to_all_recipients
Fix reply to all recipients
Diffstat (limited to 'web-ui/test/spec/services/model/mail.spec.js')
-rw-r--r-- | web-ui/test/spec/services/model/mail.spec.js | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/web-ui/test/spec/services/model/mail.spec.js b/web-ui/test/spec/services/model/mail.spec.js index 24a8d244..2cbd21e9 100644 --- a/web-ui/test/spec/services/model/mail.spec.js +++ b/web-ui/test/spec/services/model/mail.spec.js @@ -2,31 +2,17 @@ require(['services/model/mail'], function (Mail) { 'use strict'; - var testData; describe('services/model/mail', function () { - describe('reply addresses', function () { - it('returns the "to" and "cc" addresses if the mail was sent', function () { - var mail = Mail.create({ - header: { to: ['a@b.c', 'e@f.g'], cc: ['x@x.x'] }, - tags: [], - mailbox: 'SENT' - }); - - var addresses = mail.replyToAddress(); - - expect(addresses).toEqual({ to: ['a@b.c', 'e@f.g'], cc: ['x@x.x']}); - }); - }); - describe('parsing', function () { describe('a single email', function () { - var sentMail, draftMail, recievedMail, recievedMailWithCC; + var sentMail, draftMail, recievedMail, recievedMailWithCC, rawMailWithMultipleTo; beforeEach(function () { sentMail = Mail.create(Pixelated.testData().rawMail.sent); draftMail = Mail.create(Pixelated.testData().rawMail.draft); recievedMail = Mail.create(Pixelated.testData().rawMail.recieved); recievedMailWithCC = Mail.create(Pixelated.testData().rawMail.recievedWithCC); + rawMailWithMultipleTo = Mail.create(Pixelated.testData().rawMail.rawMailWithMultipleTo); }); it('correctly identifies a sent mail', function () { @@ -41,25 +27,6 @@ require(['services/model/mail'], function (Mail) { expect(recievedMail.isSentMail()).toBe(false); expect(recievedMail.isDraftMail()).toBe(false); }); - - it('reply to of a sent mail should be original recipient', function () { - expect(sentMail.replyToAddress()).toEqual({to: ['mariane_dach@davis.info'], cc: ['duda@la.lu']}); - }); - - it('reply to of a mail should be the reply_to field if existent', function () { - expect(recievedMail.replyToAddress()).toEqual({to: ['afton_braun@botsford.biz'], cc: [] }); - }); - - it('reply to of a mail should be the from field if no reply_to present', function () { - expect(recievedMailWithCC.replyToAddress()).toEqual({to: ['cleve_jaskolski@schimmelhirthe.net'], cc: []}); - }); - - it('reply to all should include all email addresses in the header', function () { - expect(recievedMailWithCC.replyToAllAddress()).toEqual({ - to: ['cleve_jaskolski@schimmelhirthe.net', 'stanford@sipes.com'], - cc: ['mariane_dach@davis.info'] - }); - }); }); describe('multipart email', function () { |