From 810cddcb122462d62b31b03295e001ea5f0252ba Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 14 Jul 2026 15:10:33 +0200 Subject: Add a :large FileAttachment style for full-width inline body images Sized generously (1600x1600>) rather than against today's cramped 490px content column specifically -- shrinking an oversized source to fit a narrow container is free and looks fine; a source too small for a future, wider redesign has no fix short of re-uploading every image. Purely additive: nothing reads :large yet, and generate_variants already loops over the whole STYLES hash generically, so no other code needed to change for new uploads to start getting it. Test suite's own hardcoded style lists updated in the same commit so they don't quietly drift out of sync with what the app actually defines. --- test/controllers/assets_controller_test.rb | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'test/controllers/assets_controller_test.rb') diff --git a/test/controllers/assets_controller_test.rb b/test/controllers/assets_controller_test.rb index ea55c90..5f5f6e5 100644 --- a/test/controllers/assets_controller_test.rb +++ b/test/controllers/assets_controller_test.rb @@ -62,8 +62,8 @@ class AssetsControllerTest < ActionController::TestCase assert_equal 'image/png', asset.upload_content_type assert asset.upload_file_size > 0 - # original and all three variants should exist on disk - %w[original medium thumb headline].each do |style| + # original and all four variants should exist on disk + %w[original medium thumb headline large].each do |style| path = Rails.root.join('public', 'system', 'uploads', asset.id.to_s, style, 'test_image.png') assert File.exist?(path), "Expected #{style} variant at #{path}" @@ -91,7 +91,7 @@ class AssetsControllerTest < ActionController::TestCase asset.id.to_s, 'original', 'test_document.pdf') assert File.exist?(original_path), "Expected original at #{original_path}" - %w[medium thumb headline].each do |style| + %w[medium thumb headline large].each do |style| path = Rails.root.join('public', 'system', 'uploads', asset.id.to_s, style, 'test_document.pdf') assert !File.exist?(path), "Expected no #{style} variant for PDF" @@ -161,6 +161,7 @@ class AssetsControllerTest < ActionController::TestCase assert_equal "/system/uploads/#{asset.id}/thumb/logo.png", asset.upload.url(:thumb) assert_equal "/system/uploads/#{asset.id}/medium/logo.png", asset.upload.url(:medium) assert_equal "/system/uploads/#{asset.id}/headline/logo.png", asset.upload.url(:headline) + assert_equal "/system/uploads/#{asset.id}/large/logo.png", asset.upload.url(:large) end # --- login required --- -- cgit v1.3