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
8cabf62b
Commit
8cabf62b
authored
Dec 05, 2018
by
Mark Chao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Finalize approval state when merged
parent
c89c4d82
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
0 deletions
+40
-0
app/services/merge_requests/post_merge_service.rb
app/services/merge_requests/post_merge_service.rb
+2
-0
ee/app/services/ee/merge_requests/post_merge_service.rb
ee/app/services/ee/merge_requests/post_merge_service.rb
+15
-0
ee/spec/services/ee/merge_requests/post_merge_service_spec.rb
...pec/services/ee/merge_requests/post_merge_service_spec.rb
+23
-0
No files found.
app/services/merge_requests/post_merge_service.rb
View file @
8cabf62b
...
@@ -52,3 +52,5 @@ module MergeRequests
...
@@ -52,3 +52,5 @@ module MergeRequests
end
end
end
end
end
end
MergeRequests
::
PostMergeService
.
prepend
(
EE
::
MergeRequests
::
PostMergeService
)
ee/app/services/ee/merge_requests/post_merge_service.rb
0 → 100644
View file @
8cabf62b
# frozen_string_literal: true
module
EE
module
MergeRequests
module
PostMergeService
extend
::
Gitlab
::
Utils
::
Override
override
:execute
def
execute
(
merge_request
)
super
ApprovalRules
::
FinalizeService
.
new
(
merge_request
).
execute
end
end
end
end
ee/spec/services/ee/merge_requests/post_merge_service_spec.rb
0 → 100644
View file @
8cabf62b
# frozen_string_literal: true
require
'spec_helper'
describe
MergeRequests
::
PostMergeService
do
let
(
:project
)
{
merge_request
.
target_project
}
let
(
:merge_request
)
{
create
(
:merge_request
)
}
let
(
:current_user
)
{
merge_request
.
author
}
let
(
:service
)
{
described_class
.
new
(
project
,
current_user
)
}
describe
'#execute'
do
context
'finalize approvals'
do
let
(
:finalize_service
)
{
double
(
:finalize_service
)
}
it
'executes ApprovalRules::FinalizeService'
do
expect
(
ApprovalRules
::
FinalizeService
).
to
receive
(
:new
).
and_return
(
finalize_service
)
expect
(
finalize_service
).
to
receive
(
:execute
)
service
.
execute
(
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