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
path: root/spec/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 13:02:00 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 13:02:19 +0300
commitf617de3476794b7198f07eba70b84fa401eded71 (patch)
tree28de724b54f5ab4c63d69a047d5c501d84536b47 /spec/lib
parent7418d0b3ebed03b22d42b1714f8de064b95aa425 (diff)
Add latest changes from gitlab-org/security/gitlab@14-5-stable-ee
Diffstat (limited to 'spec/lib')
-rw-r--r--spec/lib/gitlab/quick_actions/extractor_spec.rb8
1 files changed, 8 insertions, 0 deletions
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