BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
62f8cc11
Commit
62f8cc11
authored
Jan 15, 2017
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'allow_plus_sign_for_snippets' into 'master'
Allow to use '+' symbol in filenames Closes #22859 See merge request !6644
parents
e3c46a00
ad977e8b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
2 deletions
+20
-2
allow_plus_sign_for_snippets.yml
changelogs/unreleased/allow_plus_sign_for_snippets.yml
+4
-0
regex.rb
lib/gitlab/regex.rb
+2
-2
create_snippet_spec.rb
spec/features/snippets/create_snippet_spec.rb
+14
-0
No files found.
changelogs/unreleased/allow_plus_sign_for_snippets.yml
0 → 100644
View file @
62f8cc11
---
title
:
Allow to use + symbol in filenames
merge_request
:
6644
author
:
blackst0ne
lib/gitlab/regex.rb
View file @
62f8cc11
...
...
@@ -61,11 +61,11 @@ module Gitlab
end
def
file_name_regex
@file_name_regex
||=
/\A[[[:alnum:]]_\-\.\@]*\z/
.
freeze
@file_name_regex
||=
/\A[[[:alnum:]]_\-\.\@
\+
]*\z/
.
freeze
end
def
file_name_regex_message
"can contain only letters, digits, '_', '-', '@' and '.'."
"can contain only letters, digits, '_', '-', '@'
, '+'
and '.'."
end
def
file_path_regex
...
...
spec/features/snippets/create_snippet_spec.rb
View file @
62f8cc11
...
...
@@ -17,4 +17,18 @@ feature 'Create Snippet', feature: true do
expect
(
page
).
to
have_content
(
'My Snippet Title'
)
expect
(
page
).
to
have_content
(
'Hello World!'
)
end
scenario
'Authenticated user creates a snippet with + in filename'
do
fill_in
'personal_snippet_title'
,
with:
'My Snippet Title'
page
.
within
(
'.file-editor'
)
do
find
(
:xpath
,
"//input[@id='personal_snippet_file_name']"
).
set
'snippet+file+name'
find
(
:xpath
,
"//input[@id='personal_snippet_content']"
).
set
'Hello World!'
end
click_button
'Create snippet'
expect
(
page
).
to
have_content
(
'My Snippet Title'
)
expect
(
page
).
to
have_content
(
'snippet+file+name'
)
expect
(
page
).
to
have_content
(
'Hello World!'
)
end
end
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment