gitlab-org--gitlab-foss/spec/lib/gitlab/email/attachment_uploader_spec.rb
Rémy Coutable 356b2d2bd7 Get rid of is_image in FileUploader
Signed-off-by: Rémy Coutable <remy@rymai.me>
2016-07-19 18:51:09 +02:00

18 lines
549 B
Ruby

require "spec_helper"
describe Gitlab::Email::AttachmentUploader, lib: true do
describe "#execute" do
let(:project) { build(:project) }
let(:message_raw) { fixture_file("emails/attachment.eml") }
let(:message) { Mail::Message.new(message_raw) }
it "uploads all attachments and returns their links" do
links = described_class.new(message).execute(project)
link = links.first
expect(link).not_to be_nil
expect(link[:alt]).to eq("bricks")
expect(link[:url]).to include("bricks.png")
end
end
end