Commit 8110c54a authored by Alex Kalderimis's avatar Alex Kalderimis

Restore ability to assign groups

parent b1072b3f
...@@ -85,7 +85,7 @@ module QuickActions ...@@ -85,7 +85,7 @@ module QuickActions
end end
end end
failed_parse(format(_("Failed to find users for '%{params}'"), params: params)) unless users.size == args.size failed_parse(format(_("Failed to find users for '%{params}'"), params: params)) if users.size < args.size
users users
end end
......
...@@ -132,6 +132,25 @@ RSpec.describe QuickActions::InterpretService do ...@@ -132,6 +132,25 @@ RSpec.describe QuickActions::InterpretService do
expect(updates[:assignee_ids]).to match_array([user.id, user2.id]) expect(updates[:assignee_ids]).to match_array([user.id, user2.id])
end end
context 'assign command with a group of users' do
let(:group) { create(:group) }
let(:project) { create(:project, group: group) }
let(:group_members) { create_list(:user, 3) }
let(:command) { "/assign #{group.to_reference}" }
before do
group_members.each { group.add_developer(_1) }
end
it 'asssigns all group members' do
merge_request.update!(assignee_ids: [user.id])
_, updates = service.execute(command, merge_request)
expect(updates[:assignee_ids]).to match_array([user.id] + group_members.map(&:id))
end
end
context 'assign command with multiple assignees' do context 'assign command with multiple assignees' do
it 'fetches assignee and populates assignee_ids if content contains /assign' do it 'fetches assignee and populates assignee_ids if content contains /assign' do
merge_request.update!(assignee_ids: [user.id]) merge_request.update!(assignee_ids: [user.id])
......
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