mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Put timecop into safe mode and fix leaky Timecop.freeze
This commit is contained in:
@@ -594,7 +594,7 @@ GEM
|
||||
ref
|
||||
thor (0.19.1)
|
||||
tilt (1.4.1)
|
||||
timecop (0.6.2.2)
|
||||
timecop (0.8.1)
|
||||
timers (1.1.0)
|
||||
treetop (1.4.15)
|
||||
polyglot
|
||||
|
||||
1
config/initializers/timecop.rb
Normal file
1
config/initializers/timecop.rb
Normal file
@@ -0,0 +1 @@
|
||||
Timecop.safe_mode = true
|
||||
@@ -33,9 +33,10 @@ module Spree
|
||||
end
|
||||
|
||||
it "defaults available_on to now" do
|
||||
Timecop.freeze
|
||||
product = Product.new
|
||||
product.available_on.should == Time.zone.now
|
||||
Timecop.freeze do
|
||||
product = Product.new
|
||||
product.available_on.should == Time.zone.now
|
||||
end
|
||||
end
|
||||
|
||||
describe "tax category" do
|
||||
|
||||
Reference in New Issue
Block a user