diff options
author | Willem van Bergen <willem@vanbergen.org> | 2011-09-15 09:50:39 -0400 |
---|---|---|
committer | Willem van Bergen <willem@vanbergen.org> | 2011-09-15 09:50:39 -0400 |
commit | a8aaef676217f53f2812cd56f71a6b00c5d22162 (patch) | |
tree | 234254725c5702f5e94c39626fcfc06e387f12a5 | |
parent | bffaa888ac4a1ee60a9f93650b9184a9402eff09 (diff) | |
download | rails-a8aaef676217f53f2812cd56f71a6b00c5d22162.tar.gz rails-a8aaef676217f53f2812cd56f71a6b00c5d22162.tar.bz2 rails-a8aaef676217f53f2812cd56f71a6b00c5d22162.zip |
Fixed tests so that they will also run properly in other timezones.
-rw-r--r-- | activesupport/test/message_encryptor_test.rb | 4 | ||||
-rw-r--r-- | activesupport/test/message_verifier_test.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/activesupport/test/message_encryptor_test.rb b/activesupport/test/message_encryptor_test.rb index bd11b76e60..95e64fe6d1 100644 --- a/activesupport/test/message_encryptor_test.rb +++ b/activesupport/test/message_encryptor_test.rb @@ -44,8 +44,8 @@ class MessageEncryptorTest < Test::Unit::TestCase @encryptor.serializer = lambda { |value| ActiveSupport::JSON.encode(value) } @encryptor.deserializer = lambda { |value| ActiveSupport::JSON.decode(value) } - message = @encryptor.encrypt_and_sign({ :foo => 123, 'bar' => Time.local(2010) }) - assert_equal @encryptor.decrypt_and_verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00-05:00" } + message = @encryptor.encrypt_and_sign({ :foo => 123, 'bar' => Time.utc(2010) }) + assert_equal @encryptor.decrypt_and_verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00Z" } end private diff --git a/activesupport/test/message_verifier_test.rb b/activesupport/test/message_verifier_test.rb index 83f34ebc33..224e38a52a 100644 --- a/activesupport/test/message_verifier_test.rb +++ b/activesupport/test/message_verifier_test.rb @@ -37,8 +37,8 @@ class MessageVerifierTest < Test::Unit::TestCase @verifier.serializer = lambda { |value| ActiveSupport::JSON.encode(value) } @verifier.deserializer = lambda { |value| ActiveSupport::JSON.decode(value) } - message = @verifier.generate({ :foo => 123, 'bar' => Time.local(2010) }) - assert_equal @verifier.verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00-05:00" } + message = @verifier.generate({ :foo => 123, 'bar' => Time.utc(2010) }) + assert_equal @verifier.verify(message), { "foo" => 123, "bar" => "2010-01-01T00:00:00Z" } end def assert_not_verified(message) |