🐛 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:
@@ -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" } }
|
||||
|
||||
Reference in New Issue
Block a user