diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/cases/parameters_test.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/cases/parameters_test.rb b/test/cases/parameters_test.rb index 3fbdf8adee..fb0b920c6e 100644 --- a/test/cases/parameters_test.rb +++ b/test/cases/parameters_test.rb @@ -8,6 +8,16 @@ class ParameterSerializationTest < ActiveSupport::TestCase end test 'should not allow complex objects' do + assert_equal [ nil ], ActiveJob::Parameters.serialize([ nil ]) + assert_equal [ 1 ], ActiveJob::Parameters.serialize([ 1 ]) + assert_equal [ 1.0 ], ActiveJob::Parameters.serialize([ 1.0 ]) + assert_equal [ 'a' ], ActiveJob::Parameters.serialize([ 'a' ]) + assert_equal [ true ], ActiveJob::Parameters.serialize([ true ]) + assert_equal [ false ], ActiveJob::Parameters.serialize([ false ]) + assert_equal [ { a: 1 } ], ActiveJob::Parameters.serialize([ { a: 1 } ]) + assert_equal [ [ 1 ] ], ActiveJob::Parameters.serialize([ [ 1 ] ]) + assert_equal [ 1_000_000_000_000_000_000_000 ], ActiveJob::Parameters.serialize([ 1_000_000_000_000_000_000_000 ]) + err = assert_raises RuntimeError do ActiveJob::Parameters.serialize([ 1, self ]) end |