diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 15:10:33 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-14 15:10:33 +0200 |
| commit | 810cddcb122462d62b31b03295e001ea5f0252ba (patch) | |
| tree | ddbbd6f569f9c2c2196e1566ec4bb5881b43bd10 /test/controllers | |
| parent | cca0e57b21d506cd341b927984bcb68f0e461783 (diff) | |
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.
Diffstat (limited to 'test/controllers')
| -rw-r--r-- | test/controllers/assets_controller_test.rb | 7 |
1 files changed, 4 insertions, 3 deletions
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 | |||
| 62 | assert_equal 'image/png', asset.upload_content_type | 62 | assert_equal 'image/png', asset.upload_content_type |
| 63 | assert asset.upload_file_size > 0 | 63 | assert asset.upload_file_size > 0 |
| 64 | 64 | ||
| 65 | # original and all three variants should exist on disk | 65 | # original and all four variants should exist on disk |
| 66 | %w[original medium thumb headline].each do |style| | 66 | %w[original medium thumb headline large].each do |style| |
| 67 | path = Rails.root.join('public', 'system', 'uploads', | 67 | path = Rails.root.join('public', 'system', 'uploads', |
| 68 | asset.id.to_s, style, 'test_image.png') | 68 | asset.id.to_s, style, 'test_image.png') |
| 69 | assert File.exist?(path), "Expected #{style} variant at #{path}" | 69 | assert File.exist?(path), "Expected #{style} variant at #{path}" |
| @@ -91,7 +91,7 @@ class AssetsControllerTest < ActionController::TestCase | |||
| 91 | asset.id.to_s, 'original', 'test_document.pdf') | 91 | asset.id.to_s, 'original', 'test_document.pdf') |
| 92 | assert File.exist?(original_path), "Expected original at #{original_path}" | 92 | assert File.exist?(original_path), "Expected original at #{original_path}" |
| 93 | 93 | ||
| 94 | %w[medium thumb headline].each do |style| | 94 | %w[medium thumb headline large].each do |style| |
| 95 | path = Rails.root.join('public', 'system', 'uploads', | 95 | path = Rails.root.join('public', 'system', 'uploads', |
| 96 | asset.id.to_s, style, 'test_document.pdf') | 96 | asset.id.to_s, style, 'test_document.pdf') |
| 97 | assert !File.exist?(path), "Expected no #{style} variant for PDF" | 97 | assert !File.exist?(path), "Expected no #{style} variant for PDF" |
| @@ -161,6 +161,7 @@ class AssetsControllerTest < ActionController::TestCase | |||
| 161 | assert_equal "/system/uploads/#{asset.id}/thumb/logo.png", asset.upload.url(:thumb) | 161 | assert_equal "/system/uploads/#{asset.id}/thumb/logo.png", asset.upload.url(:thumb) |
| 162 | assert_equal "/system/uploads/#{asset.id}/medium/logo.png", asset.upload.url(:medium) | 162 | assert_equal "/system/uploads/#{asset.id}/medium/logo.png", asset.upload.url(:medium) |
| 163 | assert_equal "/system/uploads/#{asset.id}/headline/logo.png", asset.upload.url(:headline) | 163 | assert_equal "/system/uploads/#{asset.id}/headline/logo.png", asset.upload.url(:headline) |
| 164 | assert_equal "/system/uploads/#{asset.id}/large/logo.png", asset.upload.url(:large) | ||
| 164 | end | 165 | end |
| 165 | 166 | ||
| 166 | # --- login required --- | 167 | # --- login required --- |
