From 830e2da4ec1961322feb17f26e7fb6f124e8276d Mon Sep 17 00:00:00 2001 From: johnnyshields <27655+johnnyshields@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:56:55 +0900 Subject: [PATCH] Fix spec --- test/sassc_rails_test.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/test/sassc_rails_test.rb b/test/sassc_rails_test.rb index 394be12..4fe8d5f 100644 --- a/test/sassc_rails_test.rb +++ b/test/sassc_rails_test.rb @@ -333,12 +333,15 @@ def test_globbed_imports_work_when_globbed_file_is_changed assert_match(/new-file-test/, css_output) refute_match(/changed-file-test/, css_output) - File.open(new_file, 'w') do |file| + File.open(new_file, 'a') do |file| file.puts '.changed-file-test { color: #000; }' end + # Must clear the cache if the file is modified + Rails.application.assets.cache.clear + new_css_output = render_asset('glob_test.css') - assert_match(/new-file-test/, css_output) + assert_match(/new-file-test/, new_css_output) assert_match(/changed-file-test/, new_css_output) refute_equal css_output, new_css_output ensure