diff options
author | Rafael França <rafaelmfranca@gmail.com> | 2018-02-20 13:35:34 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-20 13:35:34 -0500 |
commit | b7b73de0df1fb2619508c99c5c10a3cab628d48e (patch) | |
tree | 2938ea3bfe7ab6a2ec789a2b3277a7ed891c06a9 /activejob/test | |
parent | c42dafd437f6392bf0fb41ac751a8e231940b67e (diff) | |
parent | 67391879f606e4ad9ef64210a23431e071b3df8c (diff) | |
download | rails-b7b73de0df1fb2619508c99c5c10a3cab628d48e.tar.gz rails-b7b73de0df1fb2619508c99c5c10a3cab628d48e.tar.bz2 rails-b7b73de0df1fb2619508c99c5c10a3cab628d48e.zip |
Merge pull request #32026 from bogdanvlviv/improve-30941
Improve ActiveJob custom argument serializers #30941
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/argument_serialization_test.rb | 8 | ||||
-rw-r--r-- | activejob/test/cases/serializers_test.rb | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/activejob/test/cases/argument_serialization_test.rb b/activejob/test/cases/argument_serialization_test.rb index 5d27813832..e5f1f087fe 100644 --- a/activejob/test/cases/argument_serialization_test.rb +++ b/activejob/test/cases/argument_serialization_test.rb @@ -102,6 +102,14 @@ class ArgumentSerializationTest < ActiveSupport::TestCase assert_instance_of ActiveSupport::HashWithIndifferentAccess, perform_round_trip([indifferent_access]).first end + test "should maintain time with zone" do + Time.use_zone "Alaska" do + time_with_zone = Time.new(2002, 10, 31, 2, 2, 2).in_time_zone + assert_instance_of ActiveSupport::TimeWithZone, perform_round_trip([time_with_zone]).first + assert_arguments_unchanged time_with_zone + end + end + test "should disallow non-string/symbol hash keys" do assert_raises ActiveJob::SerializationError do ActiveJob::Arguments.serialize [ { 1 => 2 } ] diff --git a/activejob/test/cases/serializers_test.rb b/activejob/test/cases/serializers_test.rb index a86f168d03..bee0c061bd 100644 --- a/activejob/test/cases/serializers_test.rb +++ b/activejob/test/cases/serializers_test.rb @@ -73,7 +73,7 @@ class SerializersTest < ActiveSupport::TestCase ActiveJob::Serializers.deserialize(hash) end assert_equal( - "Serializer DoNotExist is not know", + "Serializer DoNotExist is not known", error.message ) end |