Multiple issue assignee: fix for CE restrictions

This commit is contained in:
Valery Sizov 2017-05-05 20:06:22 +03:00
parent 7389bb9816
commit 0b7aabe302
2 changed files with 3 additions and 3 deletions

View file

@ -25,7 +25,7 @@ module Issues
return if params[:assignee_ids].blank?
# The number of assignees is limited by one for GitLab CE
params[:assignee_ids].slice!(0, 1)
params[:assignee_ids] = params[:assignee_ids][0, 1]
assignee_ids = params[:assignee_ids].select { |assignee_id| assignee_can_read?(issuable, assignee_id) }

View file

@ -40,7 +40,7 @@ describe Issues::UpdateService, services: true do
{
title: 'New title',
description: 'Also please fix',
assignee_ids: [user2.id, user3.id],
assignee_ids: [user2.id],
state_event: 'close',
label_ids: [label.id],
due_date: Date.tomorrow
@ -53,7 +53,7 @@ describe Issues::UpdateService, services: true do
expect(issue).to be_valid
expect(issue.title).to eq 'New title'
expect(issue.description).to eq 'Also please fix'
expect(issue.assignees).to match_array([user2, user3])
expect(issue.assignees).to match_array([user2])
expect(issue).to be_closed
expect(issue.labels).to match_array [label]
expect(issue.due_date).to eq Date.tomorrow