I'm getting a failing rpsec test and it seems like it's a difference between the system clock and how Rails evaluates the time.
expected: 2015-01-01 15:00:00.000000000 -0800
got: 2015-01-01 15:00:00.000000000 +0000
(compared using ==)
@@ -1,2 +1,2 @@
-2015-01-01 15:00:00 -0800
+2015-01-01 15:00:00 UTC
The issue here is the behavior of
Time.parse. Replacing that call with
Time.zone.parse allows an ActiveSupport::TimeWithZone
Though the particulars of the implementation may vary, you can get the sense of the design goals of
Time.parse from this documentation:
Since there are numerous conflicts among locally defined time zone abbreviations all over the world, this method is not intended to understand all of them.
GMT is considered the default time, and matches the output you report above. Replacing it with an
ActiveSupport::TimeWithZone allows Rails configuration to amend that default expectation.