From cf2f47b9521351f6ba8165efd493b73fe8c5b27f Mon Sep 17 00:00:00 2001 From: Randall Floyd Date: Fri, 13 Dec 2024 15:49:04 -0500 Subject: [PATCH] Rounding date comparisons in expectations due to drift when using the default precision --- spec/models/file_download_stat_spec.rb | 2 +- spec/models/file_view_stat_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/models/file_download_stat_spec.rb b/spec/models/file_download_stat_spec.rb index 5263af64da..5b21cd71fa 100644 --- a/spec/models/file_download_stat_spec.rb +++ b/spec/models/file_download_stat_spec.rb @@ -10,7 +10,7 @@ expect(file_stat).to respond_to(:date) expect(file_stat).to respond_to(:file_id) expect(file_stat.file_id).to eq("99") - expect(file_stat.date).to eq(date) + expect(file_stat.date.round(0)).to eq(date.round(0)) expect(file_stat.downloads).to eq(2) end diff --git a/spec/models/file_view_stat_spec.rb b/spec/models/file_view_stat_spec.rb index 2ba2d8f0ed..807c0cc306 100644 --- a/spec/models/file_view_stat_spec.rb +++ b/spec/models/file_view_stat_spec.rb @@ -11,7 +11,7 @@ expect(file_stat).to respond_to(:date) expect(file_stat).to respond_to(:file_id) expect(file_stat.file_id).to eq("99") - expect(file_stat.date).to eq(date) + expect(file_stat.date.round(0)).to eq(date.round(0)) expect(file_stat.views).to eq(25) expect(file_stat.user_id).to eq(user_id) end