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:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-08-30 00:34:15 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-08-30 00:34:15 +0300
commitb01c7ad291a81bc23d2c3fe7266eaf05de6cb434 (patch)
tree87f9ce5d469b330aa336f675194d1ce11b4b38c2 /spec/support
parenta5b2a3786056ddf99de06c8315e9a42c3bf86cd5 (diff)
parent5af535d919c50951513f5859730afd924a01c29b (diff)
Merge branch 'security-61974-limit-issue-comment-size' into 'master'
Limit the size of issuable description and comments See merge request gitlab/gitlabhq!3267
Diffstat (limited to 'spec/support')
-rw-r--r--spec/support/shared_examples/models/concern/issuable_shared_examples.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/support/shared_examples/models/concern/issuable_shared_examples.rb b/spec/support/shared_examples/models/concern/issuable_shared_examples.rb
new file mode 100644
index 00000000000..9604555c57d
--- /dev/null
+++ b/spec/support/shared_examples/models/concern/issuable_shared_examples.rb
@@ -0,0 +1,8 @@
+shared_examples_for 'matches_cross_reference_regex? fails fast' do
+ it 'fails fast for long strings' do
+ # took well under 1 second in CI https://dev.gitlab.org/gitlab/gitlabhq/merge_requests/3267#note_172823
+ expect do
+ Timeout.timeout(3.seconds) { mentionable.matches_cross_reference_regex? }
+ end.not_to raise_error
+ end
+end