Skip to content

Rails 7.2: Fix Rack::Cache uninitialized constant in cache_varies_integration_test #787

@kitcommerce

Description

@kitcommerce

Problem

cache_varies_integration_test.rb fails under Rails 7.2 + Rack 2.x pin with:

NameError: uninitialized constant Rack::Cache
    test/integration/workarea/cache_varies_integration_test.rb:55:in `block in app'

Root Cause

Under Rails 7.2 with rack ~> 2.2 pinned (required for serviceworker-rails compatibility), the rack-cache gem's Rack::Cache class is not auto-required. The test builds a Rack::Builder stack that directly references Rack::Cache without an explicit require.

Fix

Add require 'rack/cache' to the test file or test_helper.rb to ensure Rack::Cache is available when running under Rails 7.2.

Observed in

Rails 7.2 test suite appraisal (issue #768).

Client Impact: None (test infrastructure only)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingciChanges to the CI/Build Scriptsstatus:changes-requestedPR has review feedback to address

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions