diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-03-20 18:19:03 +0300 |
commit | 14bd84b61276ef29b97d23642d698de769bacfd2 (patch) | |
tree | f9eba90140c1bd874211dea17750a0d422c04080 /spec/services/issues | |
parent | 891c388697b2db0d8ee0c8358a9bdbf6dc56d581 (diff) |
Add latest changes from gitlab-org/gitlab@15-10-stable-eev15.10.0-rc42
Diffstat (limited to 'spec/services/issues')
19 files changed, 41 insertions, 29 deletions
diff --git a/spec/services/issues/after_create_service_spec.rb b/spec/services/issues/after_create_service_spec.rb index 39a6799dbad..594caed23d7 100644 --- a/spec/services/issues/after_create_service_spec.rb +++ b/spec/services/issues/after_create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::AfterCreateService do +RSpec.describe Issues::AfterCreateService, feature_category: :team_planning do include AfterNextHelpers let_it_be(:project) { create(:project) } diff --git a/spec/services/issues/base_service_spec.rb b/spec/services/issues/base_service_spec.rb new file mode 100644 index 00000000000..94165d557d8 --- /dev/null +++ b/spec/services/issues/base_service_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Issues::BaseService, feature_category: :team_planning do + describe '#constructor_container_arg' do + it { expect(described_class.constructor_container_arg("some-value")).to eq({ container: "some-value" }) } + end +end diff --git a/spec/services/issues/build_service_spec.rb b/spec/services/issues/build_service_spec.rb index 2160c45d079..0f89a746520 100644 --- a/spec/services/issues/build_service_spec.rb +++ b/spec/services/issues/build_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::BuildService do +RSpec.describe Issues::BuildService, feature_category: :team_planning do using RSpec::Parameterized::TableSyntax let_it_be(:project) { create(:project, :repository) } diff --git a/spec/services/issues/clone_service_spec.rb b/spec/services/issues/clone_service_spec.rb index eafaea93015..2fb14d8ce8e 100644 --- a/spec/services/issues/clone_service_spec.rb +++ b/spec/services/issues/clone_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::CloneService do +RSpec.describe Issues::CloneService, feature_category: :team_planning do include DesignManagementTestHelpers let_it_be(:user) { create(:user) } diff --git a/spec/services/issues/close_service_spec.rb b/spec/services/issues/close_service_spec.rb index 803808e667c..0d9b3306540 100644 --- a/spec/services/issues/close_service_spec.rb +++ b/spec/services/issues/close_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::CloseService do +RSpec.describe Issues::CloseService, feature_category: :team_planning do let(:project) { create(:project, :repository) } let(:user) { create(:user, email: "user@example.com") } let(:user2) { create(:user, email: "user2@example.com") } @@ -100,7 +100,6 @@ RSpec.describe Issues::CloseService do it_behaves_like 'an incident management tracked event', :incident_management_incident_closed it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } let(:namespace) { issue.namespace } let(:category) { described_class.to_s } let(:action) { 'incident_management_incident_closed' } diff --git a/spec/services/issues/create_service_spec.rb b/spec/services/issues/create_service_spec.rb index ada5b300d7a..d5d88baca1f 100644 --- a/spec/services/issues/create_service_spec.rb +++ b/spec/services/issues/create_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::CreateService do +RSpec.describe Issues::CreateService, feature_category: :team_planning do include AfterNextHelpers let_it_be(:group) { create(:group, :crm_enabled) } diff --git a/spec/services/issues/duplicate_service_spec.rb b/spec/services/issues/duplicate_service_spec.rb index f49bce70cd0..f9d8bf04ae9 100644 --- a/spec/services/issues/duplicate_service_spec.rb +++ b/spec/services/issues/duplicate_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::DuplicateService do +RSpec.describe Issues::DuplicateService, feature_category: :team_planning do let(:user) { create(:user) } let(:canonical_project) { create(:project) } let(:duplicate_project) { create(:project) } diff --git a/spec/services/issues/import_csv_service_spec.rb b/spec/services/issues/import_csv_service_spec.rb index 90e360f9cf1..6a147782209 100644 --- a/spec/services/issues/import_csv_service_spec.rb +++ b/spec/services/issues/import_csv_service_spec.rb @@ -6,6 +6,7 @@ RSpec.describe Issues::ImportCsvService, feature_category: :team_planning do let(:project) { create(:project) } let(:user) { create(:user) } let(:assignee) { create(:user, username: 'csv_assignee') } + let(:file) { fixture_file_upload('spec/fixtures/csv_complex.csv') } let(:service) do uploader = FileUploader.new(project) uploader.store!(file) @@ -19,8 +20,6 @@ RSpec.describe Issues::ImportCsvService, feature_category: :team_planning do end describe '#execute' do - let(:file) { fixture_file_upload('spec/fixtures/csv_complex.csv') } - subject { service.execute } it 'sets all issueable attributes and executes quick actions' do diff --git a/spec/services/issues/issuable_base_service_spec.rb b/spec/services/issues/issuable_base_service_spec.rb new file mode 100644 index 00000000000..e1680d5c908 --- /dev/null +++ b/spec/services/issues/issuable_base_service_spec.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe IssuableBaseService, feature_category: :team_planning do + describe '#constructor_container_arg' do + it { expect(described_class.constructor_container_arg("some-value")).to eq({ container: "some-value" }) } + end +end diff --git a/spec/services/issues/prepare_import_csv_service_spec.rb b/spec/services/issues/prepare_import_csv_service_spec.rb index ded23ee43b9..d318d4fd25e 100644 --- a/spec/services/issues/prepare_import_csv_service_spec.rb +++ b/spec/services/issues/prepare_import_csv_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::PrepareImportCsvService do +RSpec.describe Issues::PrepareImportCsvService, feature_category: :team_planning do let_it_be(:project) { create(:project) } let_it_be(:user) { create(:user) } diff --git a/spec/services/issues/referenced_merge_requests_service_spec.rb b/spec/services/issues/referenced_merge_requests_service_spec.rb index aee3583b834..4781daf7688 100644 --- a/spec/services/issues/referenced_merge_requests_service_spec.rb +++ b/spec/services/issues/referenced_merge_requests_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::ReferencedMergeRequestsService do +RSpec.describe Issues::ReferencedMergeRequestsService, feature_category: :team_planning do def create_referencing_mr(attributes = {}) create(:merge_request, attributes).tap do |merge_request| create(:note, :system, project: project, noteable: issue, author: user, note: merge_request.to_reference(full: true)) diff --git a/spec/services/issues/related_branches_service_spec.rb b/spec/services/issues/related_branches_service_spec.rb index 05c61d0abfc..940d988668e 100644 --- a/spec/services/issues/related_branches_service_spec.rb +++ b/spec/services/issues/related_branches_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::RelatedBranchesService do +RSpec.describe Issues::RelatedBranchesService, feature_category: :team_planning do let_it_be(:project) { create(:project, :repository, :public, public_builds: false) } let_it_be(:developer) { create(:user) } let_it_be(:issue) { create(:issue, project: project) } diff --git a/spec/services/issues/relative_position_rebalancing_service_spec.rb b/spec/services/issues/relative_position_rebalancing_service_spec.rb index 27c0394ac8b..68f1af49b5f 100644 --- a/spec/services/issues/relative_position_rebalancing_service_spec.rb +++ b/spec/services/issues/relative_position_rebalancing_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::RelativePositionRebalancingService, :clean_gitlab_redis_shared_state do +RSpec.describe Issues::RelativePositionRebalancingService, :clean_gitlab_redis_shared_state, feature_category: :team_planning do let_it_be(:project, reload: true) { create(:project, :repository_disabled, skip_disk_validation: true) } let_it_be(:user) { project.creator } let_it_be(:start) { RelativePositioning::START_POSITION } diff --git a/spec/services/issues/reopen_service_spec.rb b/spec/services/issues/reopen_service_spec.rb index 68015a2327e..0f89844a2c1 100644 --- a/spec/services/issues/reopen_service_spec.rb +++ b/spec/services/issues/reopen_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::ReopenService do +RSpec.describe Issues::ReopenService, feature_category: :team_planning do let(:project) { create(:project) } let(:issue) { create(:issue, :closed, project: project) } @@ -75,7 +75,6 @@ RSpec.describe Issues::ReopenService do it_behaves_like 'an incident management tracked event', :incident_management_incident_reopened it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } let(:namespace) { issue.namespace } let(:category) { described_class.to_s } let(:action) { 'incident_management_incident_reopened' } diff --git a/spec/services/issues/reorder_service_spec.rb b/spec/services/issues/reorder_service_spec.rb index 430a9e9f526..b98d23e0f7f 100644 --- a/spec/services/issues/reorder_service_spec.rb +++ b/spec/services/issues/reorder_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::ReorderService do +RSpec.describe Issues::ReorderService, feature_category: :team_planning do let_it_be(:user) { create_default(:user) } let_it_be(:group) { create(:group) } let_it_be(:project, reload: true) { create(:project, namespace: group) } diff --git a/spec/services/issues/resolve_discussions_spec.rb b/spec/services/issues/resolve_discussions_spec.rb index 1ac71b966bc..c2111bffdda 100644 --- a/spec/services/issues/resolve_discussions_spec.rb +++ b/spec/services/issues/resolve_discussions_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::ResolveDiscussions do +RSpec.describe Issues::ResolveDiscussions, feature_category: :team_planning do let(:project) { create(:project, :repository) } let(:user) { create(:user) } @@ -11,7 +11,7 @@ RSpec.describe Issues::ResolveDiscussions do DummyService.class_eval do include ::Issues::ResolveDiscussions - def initialize(project:, current_user: nil, params: {}) + def initialize(container:, current_user: nil, params: {}) super filter_resolve_discussion_params end @@ -26,7 +26,7 @@ RSpec.describe Issues::ResolveDiscussions do let(:other_merge_request) { create(:merge_request, source_project: project, source_branch: "fix") } describe "#merge_request_for_resolving_discussion" do - let(:service) { DummyService.new(project: project, current_user: user, params: { merge_request_to_resolve_discussions_of: merge_request.iid }) } + let(:service) { DummyService.new(container: project, current_user: user, params: { merge_request_to_resolve_discussions_of: merge_request.iid }) } it "finds the merge request" do expect(service.merge_request_to_resolve_discussions_of).to eq(merge_request) @@ -45,7 +45,7 @@ RSpec.describe Issues::ResolveDiscussions do describe "#discussions_to_resolve" do it "contains a single discussion when matching merge request and discussion are passed" do service = DummyService.new( - project: project, + container: project, current_user: user, params: { discussion_to_resolve: discussion.id, @@ -65,7 +65,7 @@ RSpec.describe Issues::ResolveDiscussions do project: merge_request.target_project, line_number: 15)]) service = DummyService.new( - project: project, + container: project, current_user: user, params: { merge_request_to_resolve_discussions_of: merge_request.iid } ) @@ -83,7 +83,7 @@ RSpec.describe Issues::ResolveDiscussions do line_number: 15 )]) service = DummyService.new( - project: project, + container: project, current_user: user, params: { merge_request_to_resolve_discussions_of: merge_request.iid } ) @@ -96,7 +96,7 @@ RSpec.describe Issues::ResolveDiscussions do it "is empty when a discussion and another merge request are passed" do service = DummyService.new( - project: project, + container: project, current_user: user, params: { discussion_to_resolve: discussion.id, diff --git a/spec/services/issues/set_crm_contacts_service_spec.rb b/spec/services/issues/set_crm_contacts_service_spec.rb index 5613cc49cc5..aa5dec20a13 100644 --- a/spec/services/issues/set_crm_contacts_service_spec.rb +++ b/spec/services/issues/set_crm_contacts_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::SetCrmContactsService do +RSpec.describe Issues::SetCrmContactsService, feature_category: :team_planning do let_it_be(:user) { create(:user) } let_it_be(:group) { create(:group, :crm_enabled) } let_it_be(:project) { create(:project, group: create(:group, :crm_enabled, parent: group)) } diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 973025bd2e3..9c81015e05e 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::UpdateService, :mailer do +RSpec.describe Issues::UpdateService, :mailer, feature_category: :team_planning do let_it_be(:user) { create(:user) } let_it_be(:user2) { create(:user) } let_it_be(:user3) { create(:user) } @@ -191,7 +191,6 @@ RSpec.describe Issues::UpdateService, :mailer do it_behaves_like 'an incident management tracked event', :incident_management_incident_change_confidential it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } let(:namespace) { issue.namespace } let(:category) { described_class.to_s } let(:label) { 'redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly' } @@ -696,7 +695,6 @@ RSpec.describe Issues::UpdateService, :mailer do it_behaves_like 'an incident management tracked event', :incident_management_incident_assigned it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } let(:namespace) { issue.namespace } let(:category) { described_class.to_s } let(:label) { 'redis_hll_counters.incident_management.incident_management_total_unique_counts_monthly' } diff --git a/spec/services/issues/zoom_link_service_spec.rb b/spec/services/issues/zoom_link_service_spec.rb index 230e4c1b5e1..f2a81cbe33f 100644 --- a/spec/services/issues/zoom_link_service_spec.rb +++ b/spec/services/issues/zoom_link_service_spec.rb @@ -2,7 +2,7 @@ require 'spec_helper' -RSpec.describe Issues::ZoomLinkService do +RSpec.describe Issues::ZoomLinkService, feature_category: :team_planning do let_it_be(:user) { create(:user) } let_it_be(:issue) { create(:issue) } @@ -97,7 +97,6 @@ RSpec.describe Issues::ZoomLinkService do it_behaves_like 'an incident management tracked event', :incident_management_incident_zoom_meeting it_behaves_like 'Snowplow event tracking with RedisHLL context' do - let(:feature_flag_name) { :route_hll_to_snowplow_phase2 } let(:namespace) { issue.namespace } let(:category) { described_class.to_s } let(:action) { 'incident_management_incident_zoom_meeting' } |