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
- Review Mongoid 8 changelog for dirty tracking / slug behavior changes
- Check if
Mongoid::Slug or equivalent needs updating
- 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)
Problem
Workarea::Catalog::ProductTest#test_slug_cachingfails under Rails 7.2 + Mongoid 8:Root Cause (suspected)
Mongoid 8 changed how dirty tracking and document-level caching works for fields that implement slug generation. The
navigable_test.rbtests 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-40core/app/models/workarea/catalog/product.rb(slug field definition)Next Steps
Mongoid::Slugor equivalent needs updatingObserved in
Rails 7.2 test suite appraisal (issue #768).
Client Impact: None (test/model infrastructure)