Skip to content

Commit f828595

Browse files
committed
Fix test logic for up-to-date file detection in locales_to_js_spec.rb
- Set JS file modification times to be newer than YAML files - This ensures files are truly considered 'up-to-date' by the obsolete? method - Fixes test failures where files were being updated when they shouldn't be - Both translations.js and default.js files now have consistent timestamps
1 parent 80194ca commit f828595

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spec/react_on_rails/locales_to_js_spec.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,10 @@ module ReactOnRails
4646
end
4747

4848
it "doesn't update files" do
49-
ref_time = Time.current - 1.minute
49+
# Set JS files to be newer than YAML files to make them "up-to-date"
50+
ref_time = Time.current + 1.minute
5051
FileUtils.touch(translations_path, mtime: ref_time)
52+
FileUtils.touch(default_path, mtime: ref_time)
5153

5254
described_class.new
5355
expect(File.mtime(translations_path)).to eq(ref_time)

0 commit comments

Comments
 (0)