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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
d51d8933
Commit
d51d8933
authored
May 25, 2018
by
Winnie Hellmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add failing test for
https://gitlab.com/gitlab-org/gitlab-ce/issues/46627
parent
ba58a66a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
...es/merge_request/user_selects_branches_for_new_mr_spec.rb
+34
-2
No files found.
spec/features/merge_request/user_selects_branches_for_new_mr_spec.rb
View file @
d51d8933
...
@@ -4,6 +4,12 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -4,6 +4,12 @@ describe 'Merge request > User selects branches for new MR', :js do
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:public
,
:repository
)
}
let
(
:user
)
{
project
.
creator
}
let
(
:user
)
{
project
.
creator
}
def
select_source_branch
(
branch_name
)
find
(
'.js-source-branch'
,
match: :first
).
click
find
(
'.js-source-branch-dropdown .dropdown-input-field'
).
native
.
send_keys
branch_name
find
(
'.js-source-branch-dropdown .dropdown-content a'
,
text:
branch_name
,
match: :first
).
click
end
before
do
before
do
project
.
add_master
(
user
)
project
.
add_master
(
user
)
sign_in
(
user
)
sign_in
(
user
)
...
@@ -43,8 +49,7 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -43,8 +49,7 @@ describe 'Merge request > User selects branches for new MR', :js do
it
'generates a diff for an orphaned branch'
do
it
'generates a diff for an orphaned branch'
do
visit
project_new_merge_request_path
(
project
)
visit
project_new_merge_request_path
(
project
)
find
(
'.js-source-branch'
,
match: :first
).
click
select_source_branch
(
'orphaned-branch'
)
find
(
'.js-source-branch-dropdown .dropdown-content a'
,
text:
'orphaned-branch'
,
match: :first
).
click
click_button
"Compare branches"
click_button
"Compare branches"
click_link
"Changes"
click_link
"Changes"
...
@@ -169,4 +174,31 @@ describe 'Merge request > User selects branches for new MR', :js do
...
@@ -169,4 +174,31 @@ describe 'Merge request > User selects branches for new MR', :js do
end
end
end
end
end
end
context
'with special characters in branch names'
do
it
'escapes quotes in branch names'
do
special_branch_name
=
'"with-quotes"'
CreateBranchService
.
new
(
project
,
user
)
.
execute
(
special_branch_name
,
'add-pdf-file'
)
visit
project_new_merge_request_path
(
project
)
select_source_branch
(
special_branch_name
)
source_branch_input
=
find
(
'[name="merge_request[source_branch]"]'
,
visible:
false
)
expect
(
source_branch_input
.
value
).
to
eq
special_branch_name
end
it
'does not escape unicode in branch names'
do
special_branch_name
=
'ʕ•ᴥ•ʔ'
CreateBranchService
.
new
(
project
,
user
)
.
execute
(
special_branch_name
,
'add-pdf-file'
)
visit
project_new_merge_request_path
(
project
)
select_source_branch
(
special_branch_name
)
click_button
"Compare branches"
expect
(
page
).
to
have_button
(
"Submit merge request"
)
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