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
bfedaab4
Commit
bfedaab4
authored
Jul 07, 2017
by
Simon Knox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests for MR controller updating approvers
parent
fddabfd2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
spec/controllers/projects/merge_requests_controller_ee_spec.rb
...controllers/projects/merge_requests_controller_ee_spec.rb
+46
-0
No files found.
spec/controllers/projects/merge_requests_controller_ee_spec.rb
View file @
bfedaab4
...
...
@@ -104,6 +104,52 @@ describe Projects::MergeRequestsController do
it_behaves_like
'update invalid issuable'
,
MergeRequest
end
context
'overriding approvers per MR'
do
before
do
project
.
update_attributes
(
approvals_before_merge:
1
)
end
context
'enabled'
do
before
do
project
.
update_attributes
(
disable_overriding_approvers_per_merge_request:
false
)
end
it
'updates approvals'
do
update_merge_request
(
approvals_before_merge:
2
)
expect
(
merge_request
.
reload
.
approvals_before_merge
).
to
eq
(
2
)
end
end
context
'disabled'
do
let
(
:new_approver
)
{
create
(
:user
)
}
let
(
:new_approver_group
)
{
create
(
:approver_group
)
}
before
do
project
.
team
<<
[
new_approver
,
:developer
]
project
.
update_attributes
(
disable_overriding_approvers_per_merge_request:
true
)
end
it
'does not update approvals_before_merge'
do
update_merge_request
(
approvals_before_merge:
2
)
expect
(
merge_request
.
reload
.
approvals_before_merge
).
to
eq
(
nil
)
end
it
'does not update approver_ids'
do
update_merge_request
(
approver_ids:
[
new_approver
].
map
(
&
:id
).
join
(
','
))
expect
(
merge_request
.
reload
.
approver_ids
).
to
be_empty
end
it
'does not update approver_group_ids'
do
update_merge_request
(
approver_group_ids:
[
new_approver_group
].
map
(
&
:id
).
join
(
','
))
expect
(
merge_request
.
reload
.
approver_group_ids
).
to
be_empty
end
end
end
context
'the approvals_before_merge param'
do
before
do
project
.
update_attributes
(
approvals_before_merge:
2
)
...
...
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