Add test to make sure the custom object key can't be serialized

This commit is contained in:
Rafael Mendonça França 2018-08-28 16:30:15 -04:00
parent 538f42900f
commit a8fff60814
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
1 changed files with 4 additions and 2 deletions

View File

@ -121,8 +121,10 @@ class ArgumentSerializationTest < ActiveSupport::TestCase
end
test "should not allow reserved hash keys" do
["_aj_globalid", :_aj_globalid, "_aj_symbol_keys", :_aj_symbol_keys,
"_aj_hash_with_indifferent_access", :_aj_hash_with_indifferent_access].each do |key|
["_aj_globalid", :_aj_globalid,
"_aj_symbol_keys", :_aj_symbol_keys,
"_aj_hash_with_indifferent_access", :_aj_hash_with_indifferent_access,
"_aj_serialized", :_aj_serialized].each do |key|
assert_raises ActiveJob::SerializationError do
ActiveJob::Arguments.serialize [key => 1]
end