diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 18:10:52 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 18:10:52 +0300 |
commit | 0552020767452da44de2bf5424096f2cb2ea6bf5 (patch) | |
tree | 9579d9f0ad3c730c33883130ec23420e80d1c5dc /spec/presenters | |
parent | e3748b81ca29b24197276767e245158d8f84fda3 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/presenters')
-rw-r--r-- | spec/presenters/packages/npm/package_presenter_spec.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/spec/presenters/packages/npm/package_presenter_spec.rb b/spec/presenters/packages/npm/package_presenter_spec.rb index 8b99e6d8605..4fa469c7cd2 100644 --- a/spec/presenters/packages/npm/package_presenter_spec.rb +++ b/spec/presenters/packages/npm/package_presenter_spec.rb @@ -86,10 +86,10 @@ RSpec.describe ::Packages::Npm::PackagePresenter do it 'avoids N+1 database queries' do check_n_plus_one(:versions) do create_list(:npm_package, 5, project: project, name: package_name).each do |npm_package| - if has_dependencies - ::Packages::DependencyLink.dependency_types.keys.each do |dependency_type| - create(:packages_dependency_link, package: npm_package, dependency_type: dependency_type) - end + next unless has_dependencies + + ::Packages::DependencyLink.dependency_types.keys.each do |dependency_type| + create(:packages_dependency_link, package: npm_package, dependency_type: dependency_type) end end end |