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-02-20 16:49:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2023-02-20 16:49:51 +0300
commit71786ddc8e28fbd3cb3fcc4b3ff15e5962a1c82e (patch)
tree6a2d93ef3fb2d353bb7739e4b57e6541f51cdd71 /spec/services/quick_actions
parenta7253423e3403b8c08f8a161e5937e1488f5f407 (diff)
Add latest changes from gitlab-org/gitlab@15-9-stable-eev15.9.0-rc42
Diffstat (limited to 'spec/services/quick_actions')
-rw-r--r--spec/services/quick_actions/interpret_service_spec.rb2
-rw-r--r--spec/services/quick_actions/target_service_spec.rb40
2 files changed, 25 insertions, 17 deletions
diff --git a/spec/services/quick_actions/interpret_service_spec.rb b/spec/services/quick_actions/interpret_service_spec.rb
index 8eccb9e41bb..257e7eb972b 100644
--- a/spec/services/quick_actions/interpret_service_spec.rb
+++ b/spec/services/quick_actions/interpret_service_spec.rb
@@ -2,7 +2,7 @@
require 'spec_helper'
-RSpec.describe QuickActions::InterpretService do
+RSpec.describe QuickActions::InterpretService, feature_category: :team_planning do
include AfterNextHelpers
let_it_be(:group) { create(:group, :crm_enabled) }
diff --git a/spec/services/quick_actions/target_service_spec.rb b/spec/services/quick_actions/target_service_spec.rb
index d960678f809..1b0a5d4ae73 100644
--- a/spec/services/quick_actions/target_service_spec.rb
+++ b/spec/services/quick_actions/target_service_spec.rb
@@ -12,9 +12,9 @@ RSpec.describe QuickActions::TargetService do
end
describe '#execute' do
- shared_examples 'no target' do |type_id:|
+ shared_examples 'no target' do |type_iid:|
it 'returns nil' do
- target = service.execute(type, type_id)
+ target = service.execute(type, type_iid)
expect(target).to be_nil
end
@@ -22,15 +22,15 @@ RSpec.describe QuickActions::TargetService do
shared_examples 'find target' do
it 'returns the target' do
- found_target = service.execute(type, target_id)
+ found_target = service.execute(type, target_iid)
expect(found_target).to eq(target)
end
end
- shared_examples 'build target' do |type_id:|
+ shared_examples 'build target' do |type_iid:|
it 'builds a new target' do
- target = service.execute(type, type_id)
+ target = service.execute(type, type_iid)
expect(target.project).to eq(project)
expect(target).to be_new_record
@@ -39,36 +39,44 @@ RSpec.describe QuickActions::TargetService do
context 'for issue' do
let(:target) { create(:issue, project: project) }
- let(:target_id) { target.iid }
+ let(:target_iid) { target.iid }
let(:type) { 'Issue' }
it_behaves_like 'find target'
- it_behaves_like 'build target', type_id: nil
- it_behaves_like 'build target', type_id: -1
+ it_behaves_like 'build target', type_iid: nil
+ it_behaves_like 'build target', type_iid: -1
+ end
+
+ context 'for work item' do
+ let(:target) { create(:work_item, :task, project: project) }
+ let(:target_iid) { target.iid }
+ let(:type) { 'WorkItem' }
+
+ it_behaves_like 'find target'
end
context 'for merge request' do
let(:target) { create(:merge_request, source_project: project) }
- let(:target_id) { target.iid }
+ let(:target_iid) { target.iid }
let(:type) { 'MergeRequest' }
it_behaves_like 'find target'
- it_behaves_like 'build target', type_id: nil
- it_behaves_like 'build target', type_id: -1
+ it_behaves_like 'build target', type_iid: nil
+ it_behaves_like 'build target', type_iid: -1
end
context 'for commit' do
let(:project) { create(:project, :repository) }
let(:target) { project.commit.parent }
- let(:target_id) { target.sha }
+ let(:target_iid) { target.sha }
let(:type) { 'Commit' }
it_behaves_like 'find target'
- it_behaves_like 'no target', type_id: 'invalid_sha'
+ it_behaves_like 'no target', type_iid: 'invalid_sha'
- context 'with nil target_id' do
+ context 'with nil target_iid' do
let(:target) { project.commit }
- let(:target_id) { nil }
+ let(:target_iid) { nil }
it_behaves_like 'find target'
end
@@ -77,7 +85,7 @@ RSpec.describe QuickActions::TargetService do
context 'for unknown type' do
let(:type) { 'unknown' }
- it_behaves_like 'no target', type_id: :unused
+ it_behaves_like 'no target', type_iid: :unused
end
end
end