summaryrefslogtreecommitdiff
path: root/spec/services
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 15:12:28 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2022-02-23 15:12:28 +0000
commit98014c0c43c1b1114d17c5851cd6313a9011d3ab (patch)
tree405bb6fb3e3e1bbdad0be2e4de43e353db8aeebd /spec/services
parent3f274363e9dc9a1be75edfcd3dd5adb64b1e8c29 (diff)
downloadgitlab-ce-98014c0c43c1b1114d17c5851cd6313a9011d3ab.tar.gz
Add latest changes from gitlab-org/gitlab@14-8-stable-ee
Diffstat (limited to 'spec/services')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb32
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" }