fix time_spec for rails 3

Change-Id: I11f26703b4173e6d1ccdf2ef694e781fa7adde70
Reviewed-on: https://gerrit.instructure.com/29695
Reviewed-by: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
This commit is contained in:
Cody Cutrer 2014-02-05 16:02:12 -07:00
parent 576143d795
commit 1b9df6effe
1 changed files with 4 additions and 1 deletions

View File

@ -22,7 +22,10 @@ describe 'Time Marshal override' do
it "should preserve the old marshalling for post-1900 dates" do
raw_time = Time.zone.parse('2013-02-16 05:43:21.15Z').time
dumped = Marshal.dump(raw_time)
dumped.should == "\x04\bu:\tTime\r\x05F\x1C\xC0\xF0IR\xAD"
# Rails 3 adds an instance variable of UTC time zone, so we can't do
# an exact match. I confirmed that Rails 2 can still load and safely
# ignores the extra instance variable
dumped.should =~ /:\tTime\r\x05F\x1C\xC0\xF0IR\xAD/
reloaded = Marshal.load(dumped)
reloaded.should == raw_time
end