From f617de3476794b7198f07eba70b84fa401eded71 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Fri, 3 Dec 2021 10:02:00 +0000 Subject: Add latest changes from gitlab-org/security/gitlab@14-5-stable-ee --- spec/lib/gitlab/quick_actions/extractor_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'spec/lib') diff --git a/spec/lib/gitlab/quick_actions/extractor_spec.rb b/spec/lib/gitlab/quick_actions/extractor_spec.rb index 61fffe3fb6b..c040a70e403 100644 --- a/spec/lib/gitlab/quick_actions/extractor_spec.rb +++ b/spec/lib/gitlab/quick_actions/extractor_spec.rb @@ -352,6 +352,14 @@ RSpec.describe Gitlab::QuickActions::Extractor do expect(commands).to eq(expected_commands) expect(msg).to eq expected_msg end + + it 'fails fast for strings with many newlines' do + msg = '`' + "\n" * 100_000 + + expect do + Timeout.timeout(3.seconds) { extractor.extract_commands(msg) } + end.not_to raise_error + end end describe '#redact_commands' do -- cgit v1.2.1