BigW Consortium Gitlab

Commit 96f54853 by Rémy Coutable

Merge branch 'ce-6127-move-merge-requests-services' into 'master'

CE: Extract EE specific files/lines for some merge requests files See merge request gitlab-org/gitlab-ce!19107
parents 0279a727 a7225111
...@@ -3,6 +3,12 @@ module MergeRequests ...@@ -3,6 +3,12 @@ module MergeRequests
def execute(oldrev, newrev, ref) def execute(oldrev, newrev, ref)
return true unless Gitlab::Git.branch_ref?(ref) return true unless Gitlab::Git.branch_ref?(ref)
do_execute(oldrev, newrev, ref)
end
private
def do_execute(oldrev, newrev, ref)
@oldrev, @newrev = oldrev, newrev @oldrev, @newrev = oldrev, newrev
@branch_name = Gitlab::Git.ref_name(ref) @branch_name = Gitlab::Git.ref_name(ref)
...@@ -28,8 +34,6 @@ module MergeRequests ...@@ -28,8 +34,6 @@ module MergeRequests
true true
end end
private
def close_upon_missing_source_branch_ref def close_upon_missing_source_branch_ref
# MergeRequest#reload_diff ignores not opened MRs. This means it won't # MergeRequest#reload_diff ignores not opened MRs. This means it won't
# create an `empty` diff for `closed` MRs without a source branch, keeping # create an `empty` diff for `closed` MRs without a source branch, keeping
......
...@@ -18,8 +18,13 @@ describe UpdateMergeRequestsWorker do ...@@ -18,8 +18,13 @@ describe UpdateMergeRequestsWorker do
end end
it 'executes MergeRequests::RefreshService with expected values' do it 'executes MergeRequests::RefreshService with expected values' do
expect(MergeRequests::RefreshService).to receive(:new).with(project, user).and_call_original expect(MergeRequests::RefreshService).to receive(:new)
expect_any_instance_of(MergeRequests::RefreshService).to receive(:execute).with(oldrev, newrev, ref) .with(project, user).and_wrap_original do |method, *args|
method.call(*args).tap do |refresh_service|
expect(refresh_service)
.to receive(:execute).with(oldrev, newrev, ref)
end
end
perform perform
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment