summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 10:01:58 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-03 10:02:09 +0000
commit8e01cb03b5551fee7df739c60ec880d10714c8f7 (patch)
tree7685cecb9148ee7c0ed8d53caeeb75ccfec1d0ab /spec
parent7883fc51d563f59f2fdb45be348a0cb25a834a76 (diff)
downloadgitlab-ce-8e01cb03b5551fee7df739c60ec880d10714c8f7.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-4-stable-ee
Diffstat (limited to 'spec')
-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