From ffb3c9987c2f820b99e8ad0ad56db8ae0324671c Mon Sep 17 00:00:00 2001 From: erdgeist Date: Tue, 14 Jul 2026 16:52:03 +0200 Subject: Extend static-asset cache-busting to the public layout mtime_busted_path only ever covered the four admin-only static files. The public layout has the identical exposure -- ccc.css, glightbox's vendored CSS/JS, and public.js are all served straight from public/ with no pipeline fingerprinting either -- just never got the same treatment. --- test/models/helpers/admin_helper_test.rb | 10 ---------- test/models/helpers/application_helper_test.rb | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 10 deletions(-) create mode 100644 test/models/helpers/application_helper_test.rb (limited to 'test') diff --git a/test/models/helpers/admin_helper_test.rb b/test/models/helpers/admin_helper_test.rb index 94e9861..23d9f40 100644 --- a/test/models/helpers/admin_helper_test.rb +++ b/test/models/helpers/admin_helper_test.rb @@ -1,14 +1,4 @@ require 'test_helper' class AdminHelperTest < ActionView::TestCase - test "mtime_busted_path appends the file's real mtime as a query param" do - path = "/stylesheets/admin.css" - expected_mtime = File.mtime(Rails.public_path.join("stylesheets/admin.css")).to_i - - assert_equal "#{path}?v=#{expected_mtime}", mtime_busted_path(path) - end - - test "mtime_busted_path raises clearly for a missing file rather than silently omitting the version" do - assert_raises(RuntimeError) { mtime_busted_path("/stylesheets/does_not_exist.css") } - end end diff --git a/test/models/helpers/application_helper_test.rb b/test/models/helpers/application_helper_test.rb new file mode 100644 index 0000000..56096a5 --- /dev/null +++ b/test/models/helpers/application_helper_test.rb @@ -0,0 +1,14 @@ +require 'test_helper' + +class ApplicationHelperTest < ActionView::TestCase + test "mtime_busted_path appends the file's real mtime as a query param" do + path = "/stylesheets/admin.css" + expected_mtime = File.mtime(Rails.public_path.join("stylesheets/admin.css")).to_i + + assert_equal "#{path}?v=#{expected_mtime}", mtime_busted_path(path) + end + + test "mtime_busted_path raises clearly for a missing file rather than silently omitting the version" do + assert_raises(RuntimeError) { mtime_busted_path("/stylesheets/does_not_exist.css") } + end +end -- cgit v1.3