Limit show=libs inspection view to packages with screenshots

This commit is contained in:
Christoph Haas 2026-08-23 12:33:28 +02:00
parent 3a1de72efe
commit a98398f7a1
2 changed files with 8 additions and 5 deletions

View file

@ -382,9 +382,10 @@ class PackagesController < ApplicationController
packages = packages.without_screenshots packages = packages.without_screenshots
logger.debug 'Limiting packages to those without screenshots' logger.debug 'Limiting packages to those without screenshots'
when 'libs' when 'libs'
# Temporary inspection view: exactly the packages that the libs # Temporary inspection view: exactly the screenshot-bearing
# section blacklist would remove on the next import # packages that the libs section blacklist would remove on the
packages = packages.where("section ~* '/?(old)?libs$'") # next import
packages = packages.where("section ~* '/?(old)?libs$'").with_screenshots
end end
packages packages

View file

@ -134,9 +134,11 @@ class PackagesControllerTest < ActionController::TestCase
end end
end end
test 'show=libs lists exactly the section-blacklist candidates' do test 'show=libs lists screenshot-bearing blacklist candidates only' do
packages(:firefox).update_column(:section, 'libs') packages(:firefox).update_column(:section, 'libs')
packages(:vim).update_column(:section, 'editors') # vim has no screenshots in the fixtures - even in libs section it
# must not appear
packages(:vim).update_column(:section, 'libs')
get :grid, params: { show: 'libs' } get :grid, params: { show: 'libs' }
assert_response :success assert_response :success