diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-12-20 13:37:47 +0000 |
commit | aee0a117a889461ce8ced6fcf73207fe017f1d99 (patch) | |
tree | 891d9ef189227a8445d83f35c1b0fc99573f4380 /spec/services/admin | |
parent | 8d46af3258650d305f53b819eabf7ab18d22f59e (diff) | |
download | gitlab-ce-aee0a117a889461ce8ced6fcf73207fe017f1d99.tar.gz |
Add latest changes from gitlab-org/gitlab@14-6-stable-eev14.6.0-rc42
Diffstat (limited to 'spec/services/admin')
-rw-r--r-- | spec/services/admin/propagate_integration_service_spec.rb | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/spec/services/admin/propagate_integration_service_spec.rb b/spec/services/admin/propagate_integration_service_spec.rb deleted file mode 100644 index b379286ba4f..00000000000 --- a/spec/services/admin/propagate_integration_service_spec.rb +++ /dev/null @@ -1,95 +0,0 @@ -# frozen_string_literal: true - -require 'spec_helper' - -RSpec.describe Admin::PropagateIntegrationService do - describe '.propagate' do - include JiraServiceHelper - - before do - stub_jira_integration_test - end - - let(:group) { create(:group) } - - let_it_be(:project) { create(:project) } - let_it_be(:instance_integration) { create(:jira_integration, :instance) } - let_it_be(:not_inherited_integration) { create(:jira_integration, project: project) } - let_it_be(:inherited_integration) do - create(:jira_integration, project: create(:project), inherit_from_id: instance_integration.id) - end - - let_it_be(:different_type_inherited_integration) do - create(:redmine_integration, project: project, inherit_from_id: instance_integration.id) - end - - context 'with inherited integration' do - let(:integration) { inherited_integration } - - it 'calls to PropagateIntegrationProjectWorker' do - expect(PropagateIntegrationInheritWorker).to receive(:perform_async) - .with(instance_integration.id, inherited_integration.id, inherited_integration.id) - - described_class.propagate(instance_integration) - end - end - - context 'with a project without integration' do - let(:another_project) { create(:project) } - - it 'calls to PropagateIntegrationProjectWorker' do - expect(PropagateIntegrationProjectWorker).to receive(:perform_async) - .with(instance_integration.id, another_project.id, another_project.id) - - described_class.propagate(instance_integration) - end - end - - context 'with a group without integration' do - it 'calls to PropagateIntegrationProjectWorker' do - expect(PropagateIntegrationGroupWorker).to receive(:perform_async) - .with(instance_integration.id, group.id, group.id) - - described_class.propagate(instance_integration) - end - end - - context 'for a group-level integration' do - let(:group_integration) { create(:jira_integration, :group, group: group) } - - context 'with a project without integration' do - let(:another_project) { create(:project, group: group) } - - it 'calls to PropagateIntegrationProjectWorker' do - expect(PropagateIntegrationProjectWorker).to receive(:perform_async) - .with(group_integration.id, another_project.id, another_project.id) - - described_class.propagate(group_integration) - end - end - - context 'with a subgroup without integration' do - let(:subgroup) { create(:group, parent: group) } - - it 'calls to PropagateIntegrationGroupWorker' do - expect(PropagateIntegrationGroupWorker).to receive(:perform_async) - .with(group_integration.id, subgroup.id, subgroup.id) - - described_class.propagate(group_integration) - end - end - - context 'with a subgroup with integration' do - let(:subgroup) { create(:group, parent: group) } - let(:subgroup_integration) { create(:jira_integration, :group, group: subgroup, inherit_from_id: group_integration.id) } - - it 'calls to PropagateIntegrationInheritDescendantWorker' do - expect(PropagateIntegrationInheritDescendantWorker).to receive(:perform_async) - .with(group_integration.id, subgroup_integration.id, subgroup_integration.id) - - described_class.propagate(group_integration) - end - end - end - end -end |