Skip to content

Rails 7.2 / Mongoid 8: slug_caching test failure in Catalog::ProductTest #788

@kitcommerce

Description

@kitcommerce

Problem

Workarea::Catalog::ProductTest#test_slug_caching fails under Rails 7.2 + Mongoid 8:

Failure:
Workarea::Catalog::ProductTest#test_slug_caching [testing/lib/workarea/core/navigable_test.rb:40]:
Expected: "different-slug"
  Actual: "same-slug"

Root Cause (suspected)

Mongoid 8 changed how dirty tracking and document-level caching works for fields that implement slug generation. The navigable_test.rb tests expect that saving a record with a new name generates a new slug, but Mongoid 8's caching may be returning the original slugified value.

Files Involved

  • testing/lib/workarea/core/navigable_test.rb:28-40
  • core/app/models/workarea/catalog/product.rb (slug field definition)
  • Mongoid slug generation logic

Next Steps

  1. Review Mongoid 8 changelog for dirty tracking / slug behavior changes
  2. Check if Mongoid::Slug or equivalent needs updating
  3. Fix or adapt the test to match correct Mongoid 8 behavior

Observed in

Rails 7.2 test suite appraisal (issue #768).

Client Impact: None (test/model infrastructure)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: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