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
Tatuya Kamada
gitlab-ce
Commits
ac7854a5
Commit
ac7854a5
authored
Nov 03, 2016
by
Sean McGivern
Committed by
Rémy Coutable
Nov 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merge branch '24102-cannot-unselect-remove-source-branch-when-editing-merge-request' into 'master'
Fixes #24102 See merge request !7267
parent
bf66346f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
20 additions
and
3 deletions
+20
-3
app/models/merge_request.rb
app/models/merge_request.rb
+2
-2
app/views/shared/issuable/_form.html.haml
app/views/shared/issuable/_form.html.haml
+1
-0
changelogs/unreleased/24102-cannot-unselect-remove-source-branch-when-editing-merge-request.yml
...elect-remove-source-branch-when-editing-merge-request.yml
+4
-0
spec/features/merge_requests/edit_mr_spec.rb
spec/features/merge_requests/edit_mr_spec.rb
+13
-1
No files found.
app/models/merge_request.rb
View file @
ac7854a5
...
@@ -442,11 +442,11 @@ class MergeRequest < ActiveRecord::Base
...
@@ -442,11 +442,11 @@ class MergeRequest < ActiveRecord::Base
end
end
def
should_remove_source_branch?
def
should_remove_source_branch?
merge_params
[
'should_remove_source_branch'
].
present?
Gitlab
::
Utils
.
to_boolean
(
merge_params
[
'should_remove_source_branch'
])
end
end
def
force_remove_source_branch?
def
force_remove_source_branch?
merge_params
[
'force_remove_source_branch'
].
present?
Gitlab
::
Utils
.
to_boolean
(
merge_params
[
'force_remove_source_branch'
])
end
end
def
remove_source_branch?
def
remove_source_branch?
...
...
app/views/shared/issuable/_form.html.haml
View file @
ac7854a5
...
@@ -142,6 +142,7 @@
...
@@ -142,6 +142,7 @@
.col-sm-10.col-sm-offset-2
.col-sm-10.col-sm-offset-2
.checkbox
.checkbox
=
label_tag
'merge_request[force_remove_source_branch]'
do
=
label_tag
'merge_request[force_remove_source_branch]'
do
=
hidden_field_tag
'merge_request[force_remove_source_branch]'
,
'0'
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
@merge_request
.
force_remove_source_branch?
=
check_box_tag
'merge_request[force_remove_source_branch]'
,
'1'
,
@merge_request
.
force_remove_source_branch?
Remove source branch when merge request is accepted.
Remove source branch when merge request is accepted.
...
...
changelogs/unreleased/24102-cannot-unselect-remove-source-branch-when-editing-merge-request.yml
0 → 100644
View file @
ac7854a5
---
title
:
Ensure merge request's "remove branch" accessors return booleans
merge_request
:
7267
author
:
spec/features/merge_requests/edit_mr_spec.rb
View file @
ac7854a5
...
@@ -3,7 +3,7 @@ require 'spec_helper'
...
@@ -3,7 +3,7 @@ require 'spec_helper'
feature
'Edit Merge Request'
,
feature:
true
do
feature
'Edit Merge Request'
,
feature:
true
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:project
)
{
create
(
:project
,
:public
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:
with_diffs
,
source_project:
project
)
}
let
(
:merge_request
)
{
create
(
:merge_request
,
:
simple
,
source_project:
project
)
}
before
do
before
do
project
.
team
<<
[
user
,
:master
]
project
.
team
<<
[
user
,
:master
]
...
@@ -28,5 +28,17 @@ feature 'Edit Merge Request', feature: true do
...
@@ -28,5 +28,17 @@ feature 'Edit Merge Request', feature: true do
expect
(
page
).
to
have_content
'Someone edited the merge request the same time you did'
expect
(
page
).
to
have_content
'Someone edited the merge request the same time you did'
end
end
it
'allows to unselect "Remove source branch"'
do
merge_request
.
update
(
merge_params:
{
'force_remove_source_branch'
=>
'1'
})
expect
(
merge_request
.
merge_params
[
'force_remove_source_branch'
]).
to
be_truthy
visit
edit_namespace_project_merge_request_path
(
project
.
namespace
,
project
,
merge_request
)
uncheck
'Remove source branch when merge request is accepted'
click_button
'Save changes'
expect
(
page
).
to
have_content
'Remove source branch'
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