diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-16 21:25:58 +0300 |
commit | a5f4bba440d7f9ea47046a0a561d49adf0a1e6d4 (patch) | |
tree | fb69158581673816a8cd895f9d352dcb3c678b1e /spec/services/packages/debian/create_distribution_service_spec.rb | |
parent | d16b2e8639e99961de6ddc93909f3bb5c1445ba1 (diff) |
Add latest changes from gitlab-org/gitlab@14-0-stable-eev14.0.0-rc42
Diffstat (limited to 'spec/services/packages/debian/create_distribution_service_spec.rb')
-rw-r--r-- | spec/services/packages/debian/create_distribution_service_spec.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/services/packages/debian/create_distribution_service_spec.rb b/spec/services/packages/debian/create_distribution_service_spec.rb index 87cf1070075..ecf82c6a1db 100644 --- a/spec/services/packages/debian/create_distribution_service_spec.rb +++ b/spec/services/packages/debian/create_distribution_service_spec.rb @@ -4,8 +4,12 @@ require 'spec_helper' RSpec.describe Packages::Debian::CreateDistributionService do RSpec.shared_examples 'Create Debian Distribution' do |expected_message, expected_components, expected_architectures| + let_it_be(:container) { create(container_type) } # rubocop:disable Rails/SaveBang + it 'returns ServiceResponse', :aggregate_failures do if expected_message.nil? + expect(::Packages::Debian::GenerateDistributionWorker).to receive(:perform_async).with(container_type, an_instance_of(Integer)) + expect { response } .to change { container.debian_distributions.klass.all.count } .from(0).to(1) @@ -18,6 +22,7 @@ RSpec.describe Packages::Debian::CreateDistributionService do .and not_change { Packages::Debian::ProjectComponentFile.count } .and not_change { Packages::Debian::GroupComponentFile.count } else + expect(::Packages::Debian::GenerateDistributionWorker).not_to receive(:perform_async) expect { response } .to not_change { container.debian_distributions.klass.all.count } .and not_change { container.debian_distributions.count } @@ -109,13 +114,13 @@ RSpec.describe Packages::Debian::CreateDistributionService do let(:response) { subject.execute } context 'within a projet' do - let_it_be(:container) { create(:project) } + let_it_be(:container_type) { :project } it_behaves_like 'Debian Create Distribution Service' end context 'within a group' do - let_it_be(:container) { create(:group) } + let_it_be(:container_type) { :group } it_behaves_like 'Debian Create Distribution Service' end |