Merge pull request #2136 from afurm/test/tenancy-timezone

Add focused tests for tenancy middleware and timezone cookie caching
This commit is contained in:
Mike Dalessio
2025-12-14 16:20:56 -05:00
committed by GitHub
2 changed files with 82 additions and 0 deletions
@@ -0,0 +1,17 @@
require "test_helper"
class CurrentTimezoneTest < ActionDispatch::IntegrationTest
test "includes the timezone cookie in the ETag" do
cookies[:timezone] = "America/New_York"
get user_avatar_path(users(:kevin))
etag = response.headers.fetch("ETag")
get user_avatar_path(users(:kevin)), headers: { "If-None-Match" => etag }
assert_equal 304, response.status
cookies[:timezone] = "America/Los_Angeles"
get user_avatar_path(users(:kevin)), headers: { "If-None-Match" => etag }
assert_response :success
assert_not_equal etag, response.headers.fetch("ETag")
end
end