summaryrefslogtreecommitdiff
path: root/web-ui
diff options
context:
space:
mode:
authorFolker Bernitt <fbernitt@thoughtworks.com>2016-01-28 10:45:52 +0100
committerFolker Bernitt <fbernitt@thoughtworks.com>2016-01-28 10:47:02 +0100
commit36a9354b49062a8eb8c2737d8580f38d17391642 (patch)
tree843f981b1017babbcd29329043a4d593e4f874d4 /web-ui
parent8f07c10b906b5736a7330ba8eb42af6259e0797a (diff)
Add original attachments to forwared mails
- Issue #579
Diffstat (limited to 'web-ui')
-rw-r--r--web-ui/app/js/mail_view/ui/forward_box.js1
-rw-r--r--web-ui/test/spec/mail_view/ui/forward_box.spec.js14
2 files changed, 15 insertions, 0 deletions
diff --git a/web-ui/app/js/mail_view/ui/forward_box.js b/web-ui/app/js/mail_view/ui/forward_box.js
index 2f848430..a1b8dc41 100644
--- a/web-ui/app/js/mail_view/ui/forward_box.js
+++ b/web-ui/app/js/mail_view/ui/forward_box.js
@@ -40,6 +40,7 @@ define(
this.setupForwardBox = function() {
var mail = this.attr.mail;
this.attr.subject = fwd(mail.header.subject);
+ this.attr.attachments = mail.attachments;
this.renderInlineCompose('forward-box', {
subject: this.attr.subject,
diff --git a/web-ui/test/spec/mail_view/ui/forward_box.spec.js b/web-ui/test/spec/mail_view/ui/forward_box.spec.js
index 613baa47..de6a6b0d 100644
--- a/web-ui/test/spec/mail_view/ui/forward_box.spec.js
+++ b/web-ui/test/spec/mail_view/ui/forward_box.spec.js
@@ -78,6 +78,20 @@ describeComponent('mail_view/ui/forward_box', function () {
}));
});
+ it('should copy original message attachments', function() {
+ testMail = Pixelated.testData().parsedMail.withAttachments;
+ var mailSendEvent = spyOnEvent(document, Pixelated.events.mail.send);
+
+ this.setupComponent({ mail: testMail });
+
+ this.component.attr.recipientValues.to.push('forward_to@email.com');
+ $(document).trigger(Pixelated.events.ui.mail.send);
+
+ var sentMail = mailSendEvent.mostRecentCall.data;
+
+ expect(sentMail.attachments).toEqual(testMail.attachments);
+ });
+
it('triggers openMail when email is sent', function() {
var eventSpy = spyOnEvent(document, Pixelated.events.ui.mail.open);
this.setupComponent({ mail: testMail });