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
8ff1a5bb
Commit
8ff1a5bb
authored
Apr 27, 2021
by
Anastasia McDonald
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
E2E tests for unusual names in branches and files
See
https://gitlab.com/gitlab-com/www-gitlab-com/-/issues/7228
parent
4296b032
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
0 deletions
+93
-0
qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb
...r_ui/3_create/repository/branch_with_unusual_name_spec.rb
+46
-0
qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb
...i/3_create/repository/file/file_with_unusual_name_spec.rb
+47
-0
No files found.
qa/qa/specs/features/browser_ui/3_create/repository/branch_with_unusual_name_spec.rb
0 → 100644
View file @
8ff1a5bb
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Create'
do
describe
'Branch with unusual name'
do
let
(
:branch_name
)
{
'unUsually/named#br--anch'
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
resource
|
resource
.
name
=
'unusually-named-branch-project'
resource
.
initialize_with_readme
=
true
end
end
before
do
Flow
::
Login
.
sign_in
end
context
'when branch name contains slash, hash, double dash, and capital letter'
do
it
'renders repository file tree correctly'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1780'
do
Resource
::
Repository
::
Commit
.
fabricate_via_api!
do
|
commit
|
commit
.
project
=
project
commit
.
branch
=
branch_name
commit
.
start_branch
=
project
.
default_branch
commit
.
commit_message
=
'Add new file'
commit
.
add_files
([
{
file_path:
'test-folder/test-file.md'
,
content:
'new content'
}
])
end
project
.
visit!
Page
::
Project
::
Show
.
perform
do
|
show
|
show
.
switch_to_branch
(
branch_name
)
show
.
click_file
(
'test-folder'
)
expect
(
show
).
to
have_file
(
'test-file.md'
)
show
.
click_file
(
'test-file.md'
)
expect
(
show
).
to
have_content
(
'new content'
)
end
end
end
end
end
end
qa/qa/specs/features/browser_ui/3_create/repository/file/file_with_unusual_name_spec.rb
0 → 100644
View file @
8ff1a5bb
# frozen_string_literal: true
module
QA
RSpec
.
describe
'Create'
do
describe
'File with unusual name'
do
let
(
:file_name
)
{
'-un:usually;named#file?.md'
}
let
(
:project
)
do
Resource
::
Project
.
fabricate_via_api!
do
|
resource
|
resource
.
name
=
'unusually-named-file-project'
resource
.
initialize_with_readme
=
true
end
end
before
do
Flow
::
Login
.
sign_in
end
context
'when file name starts with a dash and contains hash, semicolon, colon, and question mark'
do
it
'renders repository file tree correctly'
,
testcase:
'https://gitlab.com/gitlab-org/quality/testcases/-/issues/1779'
do
Resource
::
File
.
fabricate_via_api!
do
|
file
|
file
.
project
=
project
file
.
commit_message
=
'Add new file'
file
.
name
=
"test-folder/
#{
file_name
}
"
file
.
content
=
"### Heading
\n\n
[Gitlab link](https://gitlab.com/)"
end
project
.
visit!
Page
::
Project
::
Show
.
perform
do
|
show
|
show
.
click_file
(
'test-folder'
)
expect
(
show
).
to
have_file
(
file_name
)
show
.
click_file
(
file_name
)
aggregate_failures
'markdown file contents'
do
expect
(
show
).
to
have_content
(
'Heading'
)
expect
(
show
).
to
have_content
(
'Gitlab link'
)
expect
(
show
).
not_to
have_content
(
'###'
)
expect
(
show
).
not_to
have_content
(
'https://gitlab.com/'
)
end
end
end
end
end
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