mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-08 22:56:06 +00:00
Account for Rails 7 rounding in time spec
Storing a timestamp to the database has less accuracy than a Ruby Time object. So `updated_at` changes after being written and loaded from the database. Rails 7 accounts for that by rounding it in the model already before it's written to the database. That made one spec fail.
This commit is contained in:
@@ -309,7 +309,7 @@ module Spree
|
||||
it "defaults available_on to now" do
|
||||
Timecop.freeze do
|
||||
product = Product.new
|
||||
expect(product.available_on).to eq(Time.zone.now)
|
||||
expect(product.available_on).to be_within(0.000001).of(Time.zone.now)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user