🐛 fix: resolve stale account names in jump menu and page titles

Add account data to fresh_when etag arrays so Rails serves fresh responses after account changes.

- Add @accounts to menus controller etag

- Add Current.account to boards controller etag

- Add ETag cache invalidation tests for both controllers
This commit is contained in:
Dylan
2025-12-15 15:59:25 +08:00
parent cbaf5d245f
commit f01a648441
5 changed files with 95 additions and 3 deletions
@@ -15,6 +15,16 @@ class BoardsControllerTest < ActionDispatch::IntegrationTest
assert_response :success
end
test "invalidates page title cache when account updates" do
get board_path(boards(:writebook))
etag = response.headers["ETag"]
accounts("37s").update!(name: "Renamed Account")
get board_path(boards(:writebook)), headers: { "If-None-Match" => etag }
assert_response :success
end
test "create" do
assert_difference -> { Board.count }, +1 do
post boards_path, params: { board: { name: "Remodel Punch List" } }