Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan <king-jan1999@hotmail.de>2018-06-13 15:42:36 +0300
committerRémy Coutable <remy@rymai.me>2018-06-13 15:42:36 +0300
commit5ba9279c5039615fd797beab273f3c1aeb642dd0 (patch)
tree7a8ccb1e15d496c981331b64f6e5165a04bb8ab8 /spec/services/quick_actions
parent031ee142b1cd941eb10afd11db553173a60428f3 (diff)
Resolve "Add `/confidential` quick action for issues"
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index bd835a1fca6..743e281183e 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -323,6 +323,14 @@ describe QuickActions::InterpretService do
end
end
+ shared_examples 'confidential command' do
+ it 'marks issue as confidential if content contains /confidential' do
+ _, updates = service.execute(content, issuable)
+
+ expect(updates).to eq(confidential: true)
+ end
+ end
+
shared_examples 'shrug command' do
it 'appends ¯\_(ツ)_/¯ to the comment' do
new_content, _ = service.execute(content, issuable)
@@ -774,6 +782,11 @@ describe QuickActions::InterpretService do
let(:issuable) { issue }
end
+ it_behaves_like 'confidential command' do
+ let(:content) { '/confidential' }
+ let(:issuable) { issue }
+ end
+
context '/copy_metadata command' do
let(:todo_label) { create(:label, project: project, title: 'To Do') }
let(:inreview_label) { create(:label, project: project, title: 'In Review') }
@@ -919,6 +932,11 @@ describe QuickActions::InterpretService do
end
it_behaves_like 'empty command' do
+ let(:content) { '/confidential' }
+ let(:issuable) { issue }
+ end
+
+ it_behaves_like 'empty command' do
let(:content) { '/duplicate #{issue.to_reference}' }
let(:issuable) { issue }
end