Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/markup/rendering_service_spec.rb')
-rw-r--r--spec/services/markup/rendering_service_spec.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/spec/services/markup/rendering_service_spec.rb b/spec/services/markup/rendering_service_spec.rb
index d54bc71f0a4..99ab87f2072 100644
--- a/spec/services/markup/rendering_service_spec.rb
+++ b/spec/services/markup/rendering_service_spec.rb
@@ -75,25 +75,6 @@ RSpec.describe Markup::RenderingService do
is_expected.to eq(expected_html)
end
-
- context 'when renderer returns an error' do
- before do
- allow(Banzai).to receive(:render).and_raise(StandardError, "An error")
- end
-
- it 'returns html (rendered by ActionView:TextHelper)' do
- is_expected.to eq('<p>Noël</p>')
- end
-
- it 'logs the error' do
- expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
- instance_of(StandardError),
- project_id: context[:project].id, file_name: 'foo.md'
- )
-
- subject
- end
- end
end
context 'when file is asciidoc file' do
@@ -130,37 +111,5 @@ RSpec.describe Markup::RenderingService do
is_expected.to eq(expected_html)
end
end
-
- context 'when rendering takes too long' do
- let(:file_name) { 'foo.bar' }
-
- before do
- stub_const("Markup::RenderingService::RENDER_TIMEOUT", 0.1)
- allow(Gitlab::OtherMarkup).to receive(:render) do
- sleep(0.2)
- text
- end
- end
-
- it 'times out' do
- expect(Gitlab::RenderTimeout).to receive(:timeout).and_call_original
- expect(Gitlab::ErrorTracking).to receive(:track_exception).with(
- instance_of(Timeout::Error),
- project_id: context[:project].id, file_name: file_name
- )
-
- is_expected.to eq("<p>#{text}</p>")
- end
-
- context 'when markup_rendering_timeout is disabled' do
- it 'waits until the execution completes' do
- stub_feature_flags(markup_rendering_timeout: false)
-
- expect(Gitlab::RenderTimeout).not_to receive(:timeout)
-
- is_expected.to eq(text)
- end
- end
- end
end
end