discourse/lib/stylesheet
Alan Guo Xiang Tan 5530cb574b
DEV: Fix test incorrectly removing stylesheet cache of other processes (#25103)
Why this change?

The `can survive cache miss` test in `spec/requests/stylesheets_controller_spec.rb`
was failing because the file was not found on disk for the cache to be
regenerated. This is because a test in
`spec/lib/stylesheet/manager_spec.rb` was removing the entire
`tmp/stylesheet-cache` directory which is incorrect because the folder
in the test environment further segretates the stylesheet caches based
on the process of the test.

What does this change do?

1. Introduce `Stylesheet::Manager.rm_cache_folder` method for the test
   environment to properly clean up the cache folder.

2. Make `Stylesheet::Manager::CACHE_PATH` a private constant since the
   cache path should be obtained from the `Stylesheet::Manager.cache_fullpath` method.
2024-01-03 13:15:35 +08:00
..
manager DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00
compiler.rb DEV: Switch to sassc-embedded (#24639) 2023-12-08 10:34:03 -05:00
importer.rb FEATURE: Add dark mode option for category backgrounds (#24003) 2023-10-20 12:48:06 +00:00
manager.rb DEV: Fix test incorrectly removing stylesheet cache of other processes (#25103) 2024-01-03 13:15:35 +08:00
watcher.rb DEV: Fix various rubocop lints (#24749) 2023-12-06 23:25:00 +01:00