diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-20 12:16:11 +0300 |
commit | edaa33dee2ff2f7ea3fac488d41558eb5f86d68c (patch) | |
tree | 11f143effbfeba52329fb7afbd05e6e2a3790241 /spec/finders/packages/conan | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/finders/packages/conan')
-rw-r--r-- | spec/finders/packages/conan/package_file_finder_spec.rb | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/spec/finders/packages/conan/package_file_finder_spec.rb b/spec/finders/packages/conan/package_file_finder_spec.rb index c2f445c58f7..3da7da456c2 100644 --- a/spec/finders/packages/conan/package_file_finder_spec.rb +++ b/spec/finders/packages/conan/package_file_finder_spec.rb @@ -8,7 +8,7 @@ RSpec.describe ::Packages::Conan::PackageFileFinder do let(:package_file_name) { package_file.file_name } let(:params) { {} } - RSpec.shared_examples 'package file finder examples' do + shared_examples 'package file finder examples' do it { is_expected.to eq(package_file) } context 'with conan_file_type' do @@ -39,11 +39,37 @@ RSpec.describe ::Packages::Conan::PackageFileFinder do end end + shared_examples 'not returning pending_destruction package files' do + let_it_be(:recent_package_file_pending_destruction) do + create(:package_file, :pending_destruction, package: package, file_name: package_file.file_name) + end + + it 'returns the correct package file' do + expect(package.package_files.last).to eq(recent_package_file_pending_destruction) + + expect(subject).to eq(package_file) + end + + context 'with packages_installable_package_files disabled' do + before do + stub_feature_flags(packages_installable_package_files: false) + end + + it 'returns the correct package file' do + expect(package.package_files.last).to eq(recent_package_file_pending_destruction) + + expect(subject).to eq(recent_package_file_pending_destruction) + end + end + end + describe '#execute' do subject { described_class.new(package, package_file_name, params).execute } it_behaves_like 'package file finder examples' + it_behaves_like 'not returning pending_destruction package files' + context 'with unknown file_name' do let(:package_file_name) { 'unknown.jpg' } @@ -56,6 +82,8 @@ RSpec.describe ::Packages::Conan::PackageFileFinder do it_behaves_like 'package file finder examples' + it_behaves_like 'not returning pending_destruction package files' + context 'with unknown file_name' do let(:package_file_name) { 'unknown.jpg' } |