diff options
author | Eric Eastwood <contact@ericeastwood.com> | 2017-08-25 16:05:32 -0500 |
---|---|---|
committer | Eric Eastwood <contact@ericeastwood.com> | 2017-08-25 16:38:13 -0500 |
commit | 18bcbe30c955030391c47d8211360991f75479a5 (patch) | |
tree | 17bf45cb297f1e0bd0ff727180ef0bf4f7ea8dad /spec/javascripts/repo | |
parent | 2352f187a601be70eaeb795b7ff8c9199726debf (diff) | |
download | gitlab-ce-fix-repo-editor-regex.tar.gz |
Move repo specific dropdown label processing into the configfix-repo-editor-regex
See
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13390#note_38460888
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/13428#note_38462176
Diffstat (limited to 'spec/javascripts/repo')
-rw-r--r-- | spec/javascripts/repo/helpers/get_safe_branch_name_helper_spec.js | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/javascripts/repo/helpers/get_safe_branch_name_helper_spec.js b/spec/javascripts/repo/helpers/get_safe_branch_name_helper_spec.js new file mode 100644 index 00000000000..f426227fa60 --- /dev/null +++ b/spec/javascripts/repo/helpers/get_safe_branch_name_helper_spec.js @@ -0,0 +1,13 @@ +import getSafeBranchName from '~/repo/helpers/get_safe_branch_name_helper'; + +describe('getSafeBranchName', () => { + it('does not replace repeated dashes with single dashes', () => { + const branch = 'some--branch--name'; + expect(getSafeBranchName(branch)).toBe(branch); + }); + + it('removes non-alphanumeric characters', () => { + const branch = '$some#-branch!'; + expect(getSafeBranchName(branch)).toBe('some-branch'); + }); +}); |