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/lib/gitlab/regex_spec.rb')
-rw-r--r--spec/lib/gitlab/regex_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb
index 54a0b282e99..f3e8c440fba 100644
--- a/spec/lib/gitlab/regex_spec.rb
+++ b/spec/lib/gitlab/regex_spec.rb
@@ -990,4 +990,19 @@ RSpec.describe Gitlab::Regex do
it { is_expected.not_to match('../../../../../1.2.3') }
it { is_expected.not_to match('%2e%2e%2f1.2.3') }
end
+
+ describe '.saved_reply_name_regex' do
+ subject { described_class.saved_reply_name_regex }
+
+ it { is_expected.to match('test') }
+ it { is_expected.to match('test123') }
+ it { is_expected.to match('test-test') }
+ it { is_expected.to match('test-test_0123') }
+ it { is_expected.not_to match('test test') }
+ it { is_expected.not_to match('test-') }
+ it { is_expected.not_to match('/z/test_') }
+ it { is_expected.not_to match('.xtest_') }
+ it { is_expected.not_to match('.xt.est_') }
+ it { is_expected.not_to match('0test1') }
+ end
end