2020-01-14 16:07:45 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe Banzai::Pipeline::PostProcessPipeline do
|
2020-01-14 16:07:45 -05: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
|