2020-01-14 21:07:45 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 09:08:32 +00:00
|
|
|
RSpec.describe Banzai::Pipeline::PostProcessPipeline do
|
2020-01-14 21:07:45 +00:00
|
|
|
context 'when a document only has upload links' do
|
|
|
|
it 'does not make any Gitaly calls', :request_store do
|
|
|
|
markdown = <<-MARKDOWN.strip_heredoc
|
|
|
|
[Relative Upload Link](/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg)
|
|
|
|
|
|
|
|
![Relative Upload Image](/uploads/e90decf88d8f96fe9e1389afc2e4a91f/test.jpg)
|
|
|
|
MARKDOWN
|
|
|
|
|
|
|
|
context = {
|
|
|
|
project: create(:project, :public, :repository),
|
|
|
|
ref: 'master'
|
|
|
|
}
|
|
|
|
|
|
|
|
Gitlab::GitalyClient.reset_counts
|
|
|
|
|
|
|
|
described_class.call(markdown, context)
|
|
|
|
|
|
|
|
expect(Gitlab::GitalyClient.get_request_count).to eq(0)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|