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:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-07-19 17:16:28 +0300
commite4384360a16dd9a19d4d2d25d0ef1f2b862ed2a6 (patch)
tree2fcdfa7dcdb9db8f5208b2562f4b4e803d671243 /spec/services/quick_actions
parentffda4e7bcac36987f936b4ba515995a6698698f0 (diff)
Add latest changes from gitlab-org/gitlab@16-2-stable-eev16.2.0-rc42
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb25
1 files changed, 21 insertions, 4 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index bd09dae0a5a..186b532233e 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -35,6 +35,7 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
end
describe '#execute' do
+ let_it_be(:work_item) { create(:work_item, :task, project: project) }
let(:merge_request) { create(:merge_request, source_project: project) }
shared_examples 'reopen command' do
@@ -301,7 +302,7 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
it 'returns due_date message: Date.new(2016, 8, 28) if content contains /due 2016-08-28' do
_, _, message = service.execute(content, issuable)
- expect(message).to eq("Set the due date to #{expected_date.to_s(:medium)}.")
+ expect(message).to eq("Set the due date to #{expected_date.to_fs(:medium)}.")
end
end
@@ -538,7 +539,12 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
_, updates, message = service.execute(content, issuable)
expect(updates).to eq(merge: merge_request.diff_head_sha)
- expect(message).to eq('Scheduled to merge this merge request (Merge when pipeline succeeds).')
+
+ if Gitlab.ee?
+ expect(message).to eq('Scheduled to merge this merge request (Merge when checks pass).')
+ else
+ expect(message).to eq('Scheduled to merge this merge request (Merge when pipeline succeeds).')
+ end
end
end
@@ -1369,6 +1375,11 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
let(:issuable) { merge_request }
end
+ it_behaves_like 'done command' do
+ let(:content) { '/done' }
+ let(:issuable) { work_item }
+ end
+
it_behaves_like 'subscribe command' do
let(:content) { '/subscribe' }
let(:issuable) { issue }
@@ -1590,6 +1601,12 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
end
end
+ context 'if issuable is a work item' do
+ it_behaves_like 'todo command' do
+ let(:issuable) { work_item }
+ end
+ end
+
context 'if issuable is a MergeRequest' do
it_behaves_like 'todo command' do
let(:issuable) { merge_request }
@@ -2860,13 +2877,13 @@ RSpec.describe QuickActions::InterpretService, feature_category: :team_planning
let_it_be(:project) { create(:project, :private) }
let_it_be(:work_item) { create(:work_item, :task, project: project) }
- let(:command) { '/type Issue' }
+ let(:command) { '/type issue' }
it 'has command available' do
_, explanations = service.explain(command, work_item)
expect(explanations)
- .to contain_exactly("Converts work item to Issue. Widgets not supported in new type are removed.")
+ .to contain_exactly("Converts work item to issue. Widgets not supported in new type are removed.")
end
end