Added more tests for reserved hash keys of ActiveJob::Arguments.
- Added tests for checking all reserved hash keys of ActiveJob::Arguments. - Moved unrelated code from the test to the correct place, i.e. newly created test.
This commit is contained in:
parent
f5a5988352
commit
26e76dc879
|
@ -62,13 +62,14 @@ class ArgumentSerializationTest < ActiveSupport::TestCase
|
|||
assert_raises ActiveJob::SerializationError do
|
||||
ActiveJob::Arguments.serialize [ { :a => [{ 2 => 3 }] } ]
|
||||
end
|
||||
|
||||
assert_raises ActiveJob::SerializationError do
|
||||
ActiveJob::Arguments.serialize [ '_aj_globalid' => 1 ]
|
||||
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|
|
||||
assert_raises ActiveJob::SerializationError do
|
||||
ActiveJob::Arguments.serialize [ :_aj_globalid => 1 ]
|
||||
ActiveJob::Arguments.serialize [key => 1]
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue