Permalink
Browse files

Merge pull request #24223 from mechanicles/reserved-keys-tests

Added more tests for reserved hash keys of ActiveJob::Arguments.
  • Loading branch information...
eileencodes committed Mar 18, 2016
2 parents 823915d + 26e76dc commit 5bd5ee1e805d8cb084822388798d120d887bfc52
Showing with 7 additions and 6 deletions.
  1. +7 −6 activejob/test/cases/argument_serialization_test.rb
@@ -62,13 +62,14 @@ class ArgumentSerializationTest < ActiveSupport::TestCase
assert_raises ActiveJob::SerializationError do
ActiveJob::Arguments.serialize [ { :a => [{ 2 => 3 }] } ]
end
end
assert_raises ActiveJob::SerializationError do
ActiveJob::Arguments.serialize [ '_aj_globalid' => 1 ]
end
assert_raises ActiveJob::SerializationError do
ActiveJob::Arguments.serialize [ :_aj_globalid => 1 ]
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 [key => 1]
end
end
end

0 comments on commit 5bd5ee1

Please sign in to comment.