Put timecop into safe mode and fix leaky Timecop.freeze

This commit is contained in:
Rohan Mitchell
2016-11-25 11:18:39 +11:00
parent 57363e2da5
commit 6795237a2d
3 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -0,0 +1 @@
Timecop.safe_mode = true

View File

@@ -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