diff options
author | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2014-07-02 19:32:40 -0700 |
---|---|---|
committer | Tatsuhiko Miyagawa <miyagawa@bulknews.net> | 2014-07-02 19:32:40 -0700 |
commit | 261e51b0caca4e1dfa08f9a398df407933fd9650 (patch) | |
tree | 48579b03cba26d06244c2e170a6ddd0671671465 /test/cases | |
parent | c15d24e56d0a00e84d2ce2e33bcb25f669e00598 (diff) | |
download | rails-261e51b0caca4e1dfa08f9a398df407933fd9650.tar.gz rails-261e51b0caca4e1dfa08f9a398df407933fd9650.tar.bz2 rails-261e51b0caca4e1dfa08f9a398df407933fd9650.zip |
Explicitly call #to_s when serializing GlobalID. Addresses #95
Diffstat (limited to 'test/cases')
-rw-r--r-- | test/cases/parameters_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/cases/parameters_test.rb b/test/cases/parameters_test.rb index 737f3c26b7..76e8a8059a 100644 --- a/test/cases/parameters_test.rb +++ b/test/cases/parameters_test.rb @@ -26,8 +26,8 @@ class ParameterSerializationTest < ActiveSupport::TestCase end test 'should dive deep into arrays or hashes' do - assert_equal [ { "a" => Person.find(5).gid }.with_indifferent_access ], ActiveJob::Arguments.serialize([ { a: Person.find(5) } ]) - assert_equal [ [ Person.find(5).gid ] ], ActiveJob::Arguments.serialize([ [ Person.find(5) ] ]) + assert_equal [ { "a" => Person.find(5).gid.to_s }.with_indifferent_access ], ActiveJob::Arguments.serialize([ { a: Person.find(5) } ]) + assert_equal [ [ Person.find(5).gid.to_s ] ], ActiveJob::Arguments.serialize([ [ Person.find(5) ] ]) end test 'should dive deep into arrays or hashes and raise exception on complex objects' do @@ -45,11 +45,11 @@ class ParameterSerializationTest < ActiveSupport::TestCase end test 'should serialize records with global id' do - assert_equal [ Person.find(5).gid ], ActiveJob::Arguments.serialize([ Person.find(5) ]) + assert_equal [ Person.find(5).gid.to_s ], ActiveJob::Arguments.serialize([ Person.find(5) ]) end test 'should serialize values and records together' do - assert_equal [ 3, Person.find(5).gid ], ActiveJob::Arguments.serialize([ 3, Person.find(5) ]) + assert_equal [ 3, Person.find(5).gid.to_s ], ActiveJob::Arguments.serialize([ 3, Person.find(5) ]) end end |