Browse files

Fixed tests so that they will also run properly in other timezones.

  • Loading branch information...
1 parent bffaa88 commit a8aaef676217f53f2812cd56f71a6b00c5d22162 @wvanbergen committed Sep 15, 2011
Showing with 4 additions and 4 deletions.
  1. +2 −2 activesupport/test/message_encryptor_test.rb
  2. +2 −2 activesupport/test/message_verifier_test.rb
View
4 activesupport/test/message_encryptor_test.rb
@@ -44,8 +44,8 @@ def test_alternative_serialization_method
@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
View
4 activesupport/test/message_verifier_test.rb
@@ -37,8 +37,8 @@ def test_alternative_serialization_method
@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)

0 comments on commit a8aaef6

Please sign in to comment.