diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 12:08:19 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-01-14 12:08:19 +0300 |
commit | 02ab65d49fc94be7c91e511899762236c122977d (patch) | |
tree | 4d4bf4ec54a95a0d73e039fa1410ea841156ffb2 /spec/lib/gitlab/email | |
parent | 4411353300cf8219d2b899785bc5103c549ba8cf (diff) |
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.rb | 2 | ||||
-rw-r--r-- | spec/lib/gitlab/email/handler/create_note_handler_spec.rb | 13 |
2 files changed, 13 insertions, 2 deletions
diff --git a/spec/lib/gitlab/email/attachment_uploader_spec.rb b/spec/lib/gitlab/email/attachment_uploader_spec.rb index d66a746284d..c69b2f1eabc 100644 --- a/spec/lib/gitlab/email/attachment_uploader_spec.rb +++ b/spec/lib/gitlab/email/attachment_uploader_spec.rb @@ -9,7 +9,7 @@ describe Gitlab::Email::AttachmentUploader do let(:message) { Mail::Message.new(message_raw) } it "uploads all attachments and returns their links" do - links = described_class.new(message).execute(project) + links = described_class.new(message).execute(upload_parent: project, uploader_class: FileUploader) link = links.first expect(link).not_to be_nil diff --git a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb index 50e473c459e..909a7618df4 100644 --- a/spec/lib/gitlab/email/handler/create_note_handler_spec.rb +++ b/spec/lib/gitlab/email/handler/create_note_handler_spec.rb @@ -181,10 +181,21 @@ describe Gitlab::Email::Handler::CreateNoteHandler do it_behaves_like 'a reply to existing comment' it "adds all attachments" do + expect_next_instance_of(Gitlab::Email::AttachmentUploader) do |uploader| + expect(uploader).to receive(:execute).with(upload_parent: project, uploader_class: FileUploader).and_return( + [ + { + url: "uploads/image.png", + alt: "image", + markdown: markdown + } + ] + ) + end + receiver.execute note = noteable.notes.last - expect(note.note).to include(markdown) end |