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/support/shared_examples/models/packages/debian/distribution_shared_examples.rb | |
parent | d8a5691316400a0f7ec4f83832698f1988eb27c1 (diff) |
Add latest changes from gitlab-org/gitlab@14-7-stable-eev14.7.0-rc42
Diffstat (limited to 'spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb b/spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb index 750d3dd11e3..3f8c3b8960b 100644 --- a/spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb +++ b/spec/support/shared_examples/models/packages/debian/distribution_shared_examples.rb @@ -198,7 +198,6 @@ RSpec.shared_examples 'Debian Distribution' do |factory, container, can_freeze| describe 'relationships' do it { is_expected.to have_many(:publications).class_name('Packages::Debian::Publication').inverse_of(:distribution).with_foreign_key(:distribution_id) } it { is_expected.to have_many(:packages).class_name('Packages::Package').through(:publications) } - it { is_expected.to have_many(:package_files).class_name('Packages::PackageFile').through(:packages) } end end else @@ -229,6 +228,26 @@ RSpec.shared_examples 'Debian Distribution' do |factory, container, can_freeze| it 'returns only files from public packages with same codename' do expect(subject.to_a).to contain_exactly(*public_package_with_same_codename.package_files) end + + context 'with pending destruction package files' do + let_it_be(:package_file_pending_destruction) { create(:package_file, :pending_destruction, package: public_package_with_same_codename) } + + it 'does not return them' do + expect(subject.to_a).not_to include(package_file_pending_destruction) + end + + context 'with packages_installable_package_files disabled' do + before do + stub_feature_flags(packages_installable_package_files: false) + end + + it 'returns them' do + subject + + expect(subject.to_a).to include(package_file_pending_destruction) + end + end + end end end end |