Commit 84324dc34587f2b54542f03cc88141a887c1a5a2
1 parent
8bd0e8a4
Exists in
master
and in
14 other branches
Fixed Brasilia tests for ActiveRecord 3.1
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
test/test_helper.rb
... | ... | @@ -6,10 +6,7 @@ require "logger" |
6 | 6 | |
7 | 7 | Minitest::Test = Minitest::Unit::TestCase unless defined?(Minitest::Test) |
8 | 8 | |
9 | -# TODO determine why this is necessary | |
10 | -if RUBY_PLATFORM == "java" | |
11 | - ENV["TZ"] = "UTC" | |
12 | -end | |
9 | +ENV["TZ"] = "UTC" | |
13 | 10 | |
14 | 11 | # for debugging |
15 | 12 | # ActiveRecord::Base.logger = Logger.new(STDOUT) |
... | ... | @@ -766,8 +763,9 @@ module TestGroupdate |
766 | 763 | # Brasilia Summer Time |
767 | 764 | |
768 | 765 | def test_brasilia_summer_time |
769 | - create_user("2014-10-19 02:00:00 BRST") | |
770 | - create_user("2014-10-20 02:00:00 BRST") | |
766 | + # must parse and convert to UTC for ActiveRecord 3.1 | |
767 | + create_user(brasilia.parse("2014-10-19 02:00:00").utc.to_s) | |
768 | + create_user(brasilia.parse("2014-10-20 02:00:00").utc.to_s) | |
771 | 769 | expected = { |
772 | 770 | brasilia.parse("2014-10-19 01:00:00") => 1, |
773 | 771 | brasilia.parse("2014-10-20 00:00:00") => 1 | ... | ... |