From 98014c0c43c1b1114d17c5851cd6313a9011d3ab Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 23 Feb 2022 15:12:28 +0000 Subject: Add latest changes from gitlab-org/gitlab@14-8-stable-ee --- .../quick_actions/interpret_service_spec.rb | 32 ++++++++++------------ 1 file changed, 14 insertions(+), 18 deletions(-) (limited to 'spec/services') diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb index ca3ae437540..afeb95a3ca3 100644 --- a/spec/services/quick_actions/interpret_service_spec.rb +++ b/spec/services/quick_actions/interpret_service_spec.rb @@ -682,6 +682,20 @@ RSpec.describe QuickActions::InterpretService do expect(message).to eq("Assigned #{developer.to_reference}.") end + + context 'when the user has a private profile' do + let(:user) { create(:user, :private_profile) } + let(:content) { "/assign #{user.to_reference}" } + + it 'assigns to the user' do + issuable.project.add_developer(user) + + _, updates, message = service.execute(content, issuable) + + expect(updates).to eq(assignee_ids: [user.id]) + expect(message).to eq("Assigned #{user.to_reference}.") + end + end end shared_examples 'assign_reviewer command' do @@ -971,24 +985,6 @@ RSpec.describe QuickActions::InterpretService do it_behaves_like 'assign_reviewer command' end - context 'with a private user' do - let(:ref) { create(:user, :unconfirmed).to_reference } - let(:content) { "/assign_reviewer #{ref}" } - - it_behaves_like 'failed command', 'a parse error' do - let(:match_msg) { eq "Could not apply assign_reviewer command. Failed to find users for '#{ref}'." } - end - end - - context 'with a private user, bare username' do - let(:ref) { create(:user, :unconfirmed).username } - let(:content) { "/assign_reviewer #{ref}" } - - it_behaves_like 'failed command', 'a parse error' do - let(:match_msg) { eq "Could not apply assign_reviewer command. Failed to find users for '#{ref}'." } - end - end - context 'with @all' do let(:content) { "/assign_reviewer @all" } -- cgit v1.2.3