Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
c16b24af
Commit
c16b24af
authored
Dec 13, 2016
by
winniehell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test for #20190
parent
0d04db92
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
44 additions
and
0 deletions
+44
-0
spec/features/projects/files/creating_a_file_spec.rb
spec/features/projects/files/creating_a_file_spec.rb
+44
-0
No files found.
spec/features/projects/files/creating_a_file_spec.rb
0 → 100644
View file @
c16b24af
require
'spec_helper'
feature
'User wants to create a file'
,
feature:
true
do
include
WaitForAjax
let
(
:project
)
{
create
(
:project
)
}
let
(
:user
)
{
create
(
:user
)
}
background
do
project
.
team
<<
[
user
,
:master
]
login_as
user
visit
namespace_project_new_blob_path
(
project
.
namespace
,
project
,
project
.
default_branch
)
end
def
submit_new_file
(
options
)
file_name
=
find
(
'#file_name'
)
file_name
.
set
options
[
:file_name
]
||
'README.md'
file_content
=
find
(
'#file-content'
)
file_content
.
set
options
[
:file_content
]
||
'Some content'
click_button
'Commit Changes'
end
scenario
'file name contains Chinese characters'
do
submit_new_file
(
file_name:
'测试.md'
)
expect
(
page
).
to
have_content
'The file has been successfully created.'
end
scenario
'directory name contains Chinese characters'
do
submit_new_file
(
file_name:
'中文/测试.md'
)
expect
(
page
).
to
have_content
'The file has been successfully created.'
end
scenario
'file name contains invalid characters'
do
submit_new_file
(
file_name:
'\\'
)
expect
(
page
).
to
have_content
'Your changes could not be committed, because the file name can contain only'
end
scenario
'file name contains directory traversal'
do
submit_new_file
(
file_name:
'../README.md'
)
expect
(
page
).
to
have_content
'Your changes could not be committed, because the file name cannot include directory traversal.'
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