Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit a8aaef676217f53f2812cd56f71a6b00c5d22162 1 parent bffaa88
@wvanbergen authored
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)
Please sign in to comment.
Something went wrong with that request. Please try again.