From a98398f7a1739c53f3a60564d6aceb7bae38eb35 Mon Sep 17 00:00:00 2001 From: Christoph Haas Date: Sun, 23 Aug 2026 12:33:28 +0200 Subject: [PATCH] Limit show=libs inspection view to packages with screenshots --- app/controllers/packages_controller.rb | 7 ++++--- test/controllers/packages_controller_test.rb | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/controllers/packages_controller.rb b/app/controllers/packages_controller.rb index 3be3c49..b86d1b5 100644 --- a/app/controllers/packages_controller.rb +++ b/app/controllers/packages_controller.rb @@ -382,9 +382,10 @@ class PackagesController < ApplicationController packages = packages.without_screenshots logger.debug 'Limiting packages to those without screenshots' when 'libs' - # Temporary inspection view: exactly the packages that the libs - # section blacklist would remove on the next import - packages = packages.where("section ~* '/?(old)?libs$'") + # Temporary inspection view: exactly the screenshot-bearing + # packages that the libs section blacklist would remove on the + # next import + packages = packages.where("section ~* '/?(old)?libs$'").with_screenshots end packages diff --git a/test/controllers/packages_controller_test.rb b/test/controllers/packages_controller_test.rb index d18e81f..ef6a7ef 100644 --- a/test/controllers/packages_controller_test.rb +++ b/test/controllers/packages_controller_test.rb @@ -134,9 +134,11 @@ class PackagesControllerTest < ActionController::TestCase 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(: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' } assert_response :success