You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 19, 2018. It is now read-only.
Had an issue where server time was being used rather than time zone of the app. Below is an example using a combination of Timecop and stubbing that I was able to use to simulate the issue. Could there be a way to set an option in hyper-spec to offset the local vs server time?
context'calculating delivery at date'do{est: Time.parse('2018-04-09 21:00:00 -0400'),hst: Time.parse('2018-04-09 15:00:00 -10:00')}.eachdo |time_zone,time|
context"for #{time_zone} location"dobeforedoTimecop.freeze(time)allow(Time).toreceive(:now).and_return(Time.now.utc)endafter{Timecop.return}# When order is checked out the order is not yet createdit'should calculate correctly when created at is nil'doorder=FactoryGirl.create(:order)order.created_at=nilexpect(order.calculate_delivery_at).toeq(Time.parse('2018-04-17'))endit'should calculate correctly with fullfillment'doorder=FactoryGirl.create(:order,:with_fullfillment_job)expect(order.calculate_delivery_at).toeq(Time.parse('2018-04-19'))endit'should calculate correctly when proofs are approved'doorder=FactoryGirl.create(:order)expect(order.calculate_delivery_at(true)).toeq(Time.parse('2018-04-17'))endendendend
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Had an issue where server time was being used rather than time zone of the app. Below is an example using a combination of Timecop and stubbing that I was able to use to simulate the issue. Could there be a way to set an option in hyper-spec to offset the local vs server time?
The text was updated successfully, but these errors were encountered: