summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-09 20:32:21 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-04-09 20:32:21 +0000
commit0ec86af85e49891a72f4956df6e0505efbed6f27 (patch)
treec15de799f29d430d3df70d67980cb0e61ee96fb8
parent948a4ee666eb6f664f1207b160ae42282f37f91a (diff)
parentf9b4d5efbde0bf3b6b1822177d47199ad2f02fbd (diff)
downloadgitlab-ce-0ec86af85e49891a72f4956df6e0505efbed6f27.tar.gz
Merge branch '60305-fix-mr-assignee-for-mr-push-options' into 'master'
Fix MR assignees for push options Closes #60305 See merge request gitlab-org/gitlab-ce!27186
-rw-r--r--app/services/merge_requests/push_options_handler_service.rb4
-rw-r--r--spec/services/merge_requests/push_options_handler_service_spec.rb2
2 files changed, 3 insertions, 3 deletions
diff --git a/app/services/merge_requests/push_options_handler_service.rb b/app/services/merge_requests/push_options_handler_service.rb
index d92eb0a68c3..a24163331e8 100644
--- a/app/services/merge_requests/push_options_handler_service.rb
+++ b/app/services/merge_requests/push_options_handler_service.rb
@@ -100,7 +100,7 @@ module MergeRequests
merge_request = ::MergeRequests::CreateService.new(
project,
current_user,
- merge_request.attributes
+ merge_request.attributes.merge(assignees: merge_request.assignees)
).execute
end
@@ -119,7 +119,7 @@ module MergeRequests
def create_params(branch)
params = {
- assignee: current_user,
+ assignees: [current_user],
source_branch: branch,
source_project: project,
target_branch: push_options[:target] || target_project.default_branch,
diff --git a/spec/services/merge_requests/push_options_handler_service_spec.rb b/spec/services/merge_requests/push_options_handler_service_spec.rb
index 686b4b49f24..f7a39bb42d5 100644
--- a/spec/services/merge_requests/push_options_handler_service_spec.rb
+++ b/spec/services/merge_requests/push_options_handler_service_spec.rb
@@ -38,7 +38,7 @@ describe MergeRequests::PushOptionsHandlerService do
it 'assigns the MR to the user' do
service.execute
- expect(last_mr.assignee).to eq(user)
+ expect(last_mr.assignees).to contain_exactly(user)
end
context 'when project has been forked' do