diff options
Diffstat (limited to 'spec/services/admin/propagate_integration_service_spec.rb')
-rw-r--r-- | spec/services/admin/propagate_integration_service_spec.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/spec/services/admin/propagate_integration_service_spec.rb b/spec/services/admin/propagate_integration_service_spec.rb index 5df4d9db8b1..13320528e4f 100644 --- a/spec/services/admin/propagate_integration_service_spec.rb +++ b/spec/services/admin/propagate_integration_service_spec.rb @@ -18,6 +18,7 @@ RSpec.describe Admin::PropagateIntegrationService do let_it_be(:inherited_integration) do create(:jira_service, project: create(:project), inherit_from_id: instance_integration.id) end + let_it_be(:different_type_inherited_integration) do create(:redmine_service, project: project, inherit_from_id: instance_integration.id) end @@ -67,7 +68,7 @@ RSpec.describe Admin::PropagateIntegrationService do end end - context 'with a group without integration' do + context 'with a subgroup without integration' do let(:subgroup) { create(:group, parent: group) } it 'calls to PropagateIntegrationGroupWorker' do @@ -77,6 +78,18 @@ RSpec.describe Admin::PropagateIntegrationService do 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_service, group: subgroup, project: nil, 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 |