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
f2f8de61
Commit
f2f8de61
authored
Sep 20, 2017
by
Micaël Bergeron
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
this spec will correctly fail when reverting the fix
parent
a304a399
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
7 deletions
+13
-7
ee/app/controllers/ee/projects/merge_requests/application_controller.rb
...lers/ee/projects/merge_requests/application_controller.rb
+1
-1
spec/ee/spec/controllers/projects/merge_requests_controller_spec.rb
...ec/controllers/projects/merge_requests_controller_spec.rb
+12
-6
No files found.
ee/app/controllers/ee/projects/merge_requests/application_controller.rb
View file @
f2f8de61
...
...
@@ -36,7 +36,7 @@ module EE
def
clamp_approvals_before_merge
(
mr_params
)
return
mr_params
unless
mr_params
[
:approvals_before_merge
]
#
target the MR target project in priority, else it depends w
ether the project
#
Target the MR target project in priority, else it depends wh
ether the project
# is forked.
target_project
=
if
@merge_request
@merge_request
.
target_project
...
...
spec/ee/spec/controllers/projects/merge_requests_controller_spec.rb
View file @
f2f8de61
...
...
@@ -291,19 +291,25 @@ describe Projects::MergeRequestsController do
let
(
:upstream
)
{
create
(
:project
,
:repository
)
}
let
(
:project
)
{
create
(
:project
,
:repository
,
forked_from_project:
upstream
)
}
context
'when the MR target upstream'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
title:
'This is targeting upstream'
,
source_project:
project
,
target_project:
upstream
)
}
before
do
project
.
add_developer
(
user
)
upstream
.
add_developer
(
user
)
upstream
.
update_attributes
(
approvals_before_merge:
2
)
end
context
'when the MR target upstream'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
title:
'This is targeting upstream'
,
source_project:
project
,
target_project:
upstream
)
}
it_behaves_like
'approvals_before_merge param'
end
context
'when the MR target the fork'
do
let
(
:merge_request
)
{
create
(
:merge_request
,
title:
'This is targeting the fork'
,
source_project:
project
,
target_project:
project
)
}
before
do
project
.
add_developer
(
user
)
project
.
update_attributes
(
approvals_before_merge:
0
)
end
it_behaves_like
'approvals_before_merge param'
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