Skip to content

Commit

Permalink
Rounding date comparisons in expectations due to drift when using the…
Browse files Browse the repository at this point in the history
… default precision
  • Loading branch information
randalldfloyd committed Dec 13, 2024
1 parent cfd6cee commit cf2f47b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/models/file_download_stat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion spec/models/file_view_stat_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit cf2f47b

Please sign in to comment.