gitlab-org--gitlab-foss/spec/lib/gitlab/email/attachment_uploader_spec.rb

19 lines
539 B
Ruby
Raw Normal View History

2015-08-20 14:33:35 -04:00
require "spec_helper"
describe Gitlab::Email::AttachmentUploader do
2015-08-20 14:33:35 -04:00
describe "#execute" do
2017-12-01 08:58:49 -05:00
let(:project) { create(:project) }
2015-08-20 14:33:35 -04:00
let(:message_raw) { fixture_file("emails/attachment.eml") }
let(:message) { Mail::Message.new(message_raw) }
2015-08-20 15:41:47 -04:00
it "uploads all attachments and returns their links" do
2015-08-20 14:33:35 -04:00
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