Skip to content
Snippets Groups Projects
Unverified Commit ecda9360 authored by Cindy Pallares's avatar Cindy Pallares
Browse files

Strip whitespace from assign quick action params

parent 3cab2325
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -643,7 +643,7 @@ module QuickActions
 
if users.empty?
users =
if params == 'me'
if params.strip == 'me'
[current_user]
else
User.where(username: params.split(' ').map(&:strip))
Loading
Loading
---
title: Resolve assign-me quick action doesn't work if there is extra white space
merge_request: 22402
author:
type: fixed
Loading
Loading
@@ -538,6 +538,26 @@ describe QuickActions::InterpretService do
end
end
 
context 'assign command with me alias and whitespace' do
let(:content) { "/assign me " }
context 'Issue' do
it 'fetches assignee and populates assignee_ids if content contains /assign' do
_, updates = service.execute(content, issue)
expect(updates).to eq(assignee_ids: [developer.id])
end
end
context 'Merge Request' do
it 'fetches assignee and populates assignee_ids if content contains /assign' do
_, updates = service.execute(content, merge_request)
expect(updates).to eq(assignee_ids: [developer.id])
end
end
end
it_behaves_like 'empty command' do
let(:content) { '/assign @abcd1234' }
let(:issuable) { issue }
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment