diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-08-18 13:50:51 +0300 |
commit | db384e6b19af03b4c3c82a5760d83a3fd79f7982 (patch) | |
tree | 34beaef37df5f47ccbcf5729d7583aae093cffa0 /spec/lib/gitlab/regex_spec.rb | |
parent | 54fd7b1bad233e3944434da91d257fa7f63c3996 (diff) |
Add latest changes from gitlab-org/gitlab@16-3-stable-eev16.3.0-rc42
Diffstat (limited to 'spec/lib/gitlab/regex_spec.rb')
-rw-r--r-- | spec/lib/gitlab/regex_spec.rb | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/spec/lib/gitlab/regex_spec.rb b/spec/lib/gitlab/regex_spec.rb index 5e58282ff92..c91b99caba2 100644 --- a/spec/lib/gitlab/regex_spec.rb +++ b/spec/lib/gitlab/regex_spec.rb @@ -65,13 +65,25 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do describe '.project_name_regex_message' do subject { described_class.project_name_regex_message } - it { is_expected.to eq("can contain only letters, digits, emojis, '_', '.', '+', dashes, or spaces. It must start with a letter, digit, emoji, or '_'.") } + it { is_expected.to eq("can contain only letters, digits, emoji, '_', '.', '+', dashes, or spaces. It must start with a letter, digit, emoji, or '_'.") } end describe '.group_name_regex_message' do subject { described_class.group_name_regex_message } - it { is_expected.to eq("can contain only letters, digits, emojis, '_', '.', dash, space, parenthesis. It must start with letter, digit, emoji or '_'.") } + it { is_expected.to eq("can contain only letters, digits, emoji, '_', '.', dash, space, parenthesis. It must start with letter, digit, emoji or '_'.") } + end + + describe '.slack_link_regex' do + subject { described_class.slack_link_regex } + + it { is_expected.not_to match('http://custom-url.com|click here') } + it { is_expected.not_to match('custom-url.com|any-Charact3r$') } + it { is_expected.not_to match("<custom-url.com|any-Charact3r$>") } + + it { is_expected.to match('<http://custom-url.com|click here>') } + it { is_expected.to match('<custom-url.com|any-Charact3r$>') } + it { is_expected.to match('<any-Charact3r$|any-Charact3r$>') } end describe '.bulk_import_destination_namespace_path_regex_message' do @@ -820,6 +832,7 @@ RSpec.describe Gitlab::Regex, feature_category: :tooling do it { is_expected.to match('1.2.3') } it { is_expected.to match('1.2.3-beta') } it { is_expected.to match('1.2.3-alpha.3') } + it { is_expected.to match('1.2.3-alpha.3+abcd') } it { is_expected.not_to match('1') } it { is_expected.not_to match('1.2') } it { is_expected.not_to match('1./2.3') } |