summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/email
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 03:09:23 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-06 03:09:23 +0000
commitf098e6d3d2c8eaaec0a228c8a3ae01f770e15dd2 (patch)
tree611a38154ba90341f6c6935a51cf7962f5896790 /spec/lib/gitlab/email
parent697d1c4e06d1c232ca8b21805cc889a0991702ab (diff)
downloadgitlab-ce-f098e6d3d2c8eaaec0a228c8a3ae01f770e15dd2.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/gitlab/email')
-rw-r--r--spec/lib/gitlab/email/attachment_uploader_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb
index 462be76a58d..5104e0a3f8f 100644
--- a/spec/lib/gitlab/email/attachment_uploader_spec.rb
+++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb
@@ -31,5 +31,20 @@ describe Gitlab::Email::AttachmentUploader do
expect(image_link[:url]).to include('gitlab_logo.png')
end
end
+
+ context 'with a signed message with mixed protocol prefix' do
+ let(:message_raw) { fixture_file("emails/valid_reply_signed_smime_mixed_protocol_prefix.eml") }
+
+ it 'uploads all attachments except the signature' do
+ links = described_class.new(message).execute(upload_parent: project, uploader_class: FileUploader)
+
+ expect(links).not_to include(a_hash_including(alt: 'smime.p7s'))
+
+ image_link = links.first
+ expect(image_link).not_to be_nil
+ expect(image_link[:alt]).to eq('gitlab_logo')
+ expect(image_link[:url]).to include('gitlab_logo.png')
+ end
+ end
end
end