From 412b2fc32905914c4382a2bce8eb1149d3702039 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..d014b37f23 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(3)).to eq(date.round(3)) 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..5ec2e5331b 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(3)).to eq(date.round(3)) expect(file_stat.views).to eq(25) expect(file_stat.user_id).to eq(user_id) end