summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorLisa Junger <ljunger@thoughtworks.com>2014-10-24 17:37:44 +0200
committerAlexandre Pretto Nunes <anunes@thoughtworks.com>2014-12-03 15:47:21 -0200
commit6c5e6a65ed543193f676f601741fb597dc48e5dd (patch)
treec11576f32808289131a9816d5cb99dcdd424a2db /web-ui
parentf7472aed29c525bc630fe1ea05833f840bc42dc4 (diff)
Don't use to address for reply all.
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/services/model/mail.js2
-rw-r--r--web-ui/test/spec/services/model/mail.spec.js11
-rw-r--r--web-ui/test/test_data.js9
3 files changed, 19 insertions, 3 deletions
diff --git a/web-ui/app/js/services/model/mail.js b/web-ui/app/js/services/model/mail.js
index 3fa3ceca..f2103262 100644
--- a/web-ui/app/js/services/model/mail.js
+++ b/web-ui/app/js/services/model/mail.js
@@ -71,7 +71,7 @@ define(['helpers/contenttype'],
function replyToAllAddress() {
return {
- to: normalize([this.header.reply_to, this.header.from, this.header.to]),
+ to: normalize([this.header.reply_to, this.header.from]),
cc: normalize(this.header.cc)
};
}
diff --git a/web-ui/test/spec/services/model/mail.spec.js b/web-ui/test/spec/services/model/mail.spec.js
index 24a8d244..3ee936f6 100644
--- a/web-ui/test/spec/services/model/mail.spec.js
+++ b/web-ui/test/spec/services/model/mail.spec.js
@@ -21,12 +21,13 @@ require(['services/model/mail'], function (Mail) {
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 () {
@@ -56,7 +57,13 @@ require(['services/model/mail'], function (Mail) {
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'],
+ to: ['cleve_jaskolski@schimmelhirthe.net'],
+ cc: ['mariane_dach@davis.info']
+ });
+ });
+ it('reply to all should include all email addresses in the header even for multiple to addresses', function () {
+ expect(rawMailWithMultipleTo.replyToAllAddress()).toEqual({
+ to: ['cleve_jaskolski@schimmelhirthe.net', 'someoneelse@some-other-domain.tld'],
cc: ['mariane_dach@davis.info']
});
});
diff --git a/web-ui/test/test_data.js b/web-ui/test/test_data.js
index 194cd02d..1ea68c55 100644
--- a/web-ui/test/test_data.js
+++ b/web-ui/test/test_data.js
@@ -53,6 +53,14 @@ define(function() {
'body':'Sed est neque tempore. Alias officiis pariatur ullam porro corporis. Tempore eum quia placeat. Sapiente fuga cum.'
};
+ var rawMailWithMultipleTo = {
+ 'header':{'to':['stanford@sipes.com', 'someoneelse@some-other-domain.tld'],'from':'cleve_jaskolski@schimmelhirthe.net','cc':'mariane_dach@davis.info','subject':'Cumque pariatur vel consequuntur deleniti ex.','date':'2014-06-17T05:40:29-03:00'},
+ 'ident':242,
+ 'tags':['garden','instalovers','popularpic'],
+ 'status':['read'],
+ 'body':'Sed est neque tempore. Alias officiis pariatur ullam porro corporis. Tempore eum quia placeat. Sapiente fuga cum.'
+ };
+
var rawMultipartMail = {
header: {
to:'multipart@multipart.info',
@@ -158,6 +166,7 @@ define(function() {
draft: rawDraftMail,
recieved: rawRecievedMail,
recievedWithCC: rawRecievedWithCCMail,
+ rawMailWithMultipleTo: rawMailWithMultipleTo,
multipart: rawMultipartMail
},
parsedMail: {