diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-23 03:17:13 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-02-23 03:17:13 +0000 |
commit | a9fa13e4ba46e00081cec1f3af332edcd1520785 (patch) | |
tree | 1d3bca7bd91d7b121633cd3536c0d31031fdb7e6 /spec/services/quick_actions/interpret_service_spec.rb | |
parent | 6adb784bf2839a2b8a73de5602cbfe617836526c (diff) | |
download | gitlab-ce-a9fa13e4ba46e00081cec1f3af332edcd1520785.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/quick_actions/interpret_service_spec.rb')
-rw-r--r-- | spec/services/quick_actions/interpret_service_spec.rb | 32 |
1 files changed, 14 insertions, 18 deletions
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" } |