diff options
author | Toon Claes <toon@gitlab.com> | 2017-06-20 15:03:25 +0200 |
---|---|---|
committer | Toon Claes <toon@gitlab.com> | 2017-06-20 15:03:25 +0200 |
commit | fcd46c1af4ceeec7813a91111dfce5e492695119 (patch) | |
tree | d2d927e483c395339e8830bc2fa858b43538b665 /spec/services/quick_actions | |
parent | 132cd0092d6aea87359a9a0627ad2c53c4a91837 (diff) | |
download | gitlab-ce-fcd46c1af4ceeec7813a91111dfce5e492695119.tar.gz |
Backport /reassign quick command
The /reassign quick command works even when no multiple assignees are allowed of
there isn't any assignee yet. So for consistency, it's also be backported to
CE. But it functions the same as the /assign quick action.
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index c9e63efbc14..b1997e64557 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -362,7 +362,7 @@ describe QuickActions::InterpretService, services: true do it 'fetches assignee and populates assignee_id if content contains /assign' do _, updates = service.execute(content, issue) - expect(updates).to eq(assignee_ids: [developer.id]) + expect(updates[:assignee_ids]).to match_array([developer.id]) end end @@ -431,6 +431,22 @@ describe QuickActions::InterpretService, services: true do end end + context 'reassign command' do + let(:content) { '/reassign' } + + context 'Issue' do + it 'reassigns user if content contains /reassign @user' do + user = create(:user) + + issue.update(assignee_ids: [developer.id]) + + _, updates = service.execute("/reassign @#{user.username}", issue) + + expect(updates).to eq(assignee_ids: [user.id]) + end + end + end + it_behaves_like 'milestone command' do let(:content) { "/milestone %#{milestone.title}" } let(:issuable) { issue } |