diff options
author | Mike Perham <mperham@gmail.com> | 2016-03-09 08:56:21 -0800 |
---|---|---|
committer | Mike Perham <mperham@gmail.com> | 2016-03-09 08:56:21 -0800 |
commit | 702ef37767da7a32d34d29f8936c056d70e8fc56 (patch) | |
tree | 7d985c9cc946be4d400fa4d2ebbe24293e74d556 /activejob/test | |
parent | 5cd2beb0135faf18c978507a4be272dfc1499bb8 (diff) | |
download | rails-702ef37767da7a32d34d29f8936c056d70e8fc56.tar.gz rails-702ef37767da7a32d34d29f8936c056d70e8fc56.tar.bz2 rails-702ef37767da7a32d34d29f8936c056d70e8fc56.zip |
Job payload should be symmetric across JSON dump/load
Placing non-native JSON data types, like symbols, in the hash to serialize means that the deserialize method will return something different from what was serialized, a common bug and source of frustration for devs.
Diffstat (limited to 'activejob/test')
-rw-r--r-- | activejob/test/cases/job_serialization_test.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activejob/test/cases/job_serialization_test.rb b/activejob/test/cases/job_serialization_test.rb index 229517774e..4c5a45b658 100644 --- a/activejob/test/cases/job_serialization_test.rb +++ b/activejob/test/cases/job_serialization_test.rb @@ -15,13 +15,13 @@ class JobSerializationTest < ActiveSupport::TestCase end test 'serialize includes current locale' do - assert_equal :en, HelloJob.new.serialize['locale'] + assert_equal 'en', HelloJob.new.serialize['locale'] end test 'deserialize sets locale' do job = HelloJob.new - job.deserialize 'locale' => :es - assert_equal :es, job.locale + job.deserialize 'locale' => 'es' + assert_equal 'es', job.locale end test 'deserialize sets default locale' do |