1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

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

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