aboutsummaryrefslogtreecommitdiffstats
path: root/activejob/test/cases/argument_serialization_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activejob/test/cases/argument_serialization_test.rb')
-rw-r--r--activejob/test/cases/argument_serialization_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activejob/test/cases/argument_serialization_test.rb b/activejob/test/cases/argument_serialization_test.rb
index 8b9b62190f..933972a52b 100644
--- a/activejob/test/cases/argument_serialization_test.rb
+++ b/activejob/test/cases/argument_serialization_test.rb
@@ -88,6 +88,13 @@ class ArgumentSerializationTest < ActiveSupport::TestCase
assert_equal "Job with argument: 2", JobBuffer.last_value
end
+ test 'raises a friendly SerializationError for records without ids' do
+ err = assert_raises ActiveJob::SerializationError do
+ ActiveJob::Arguments.serialize [Person.new(nil)]
+ end
+ assert_match 'Unable to serialize Person without an id.', err.message
+ end
+
private
def assert_arguments_unchanged(*args)
assert_arguments_roundtrip args