aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/coders/json_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/coders/json_test.rb')
-rw-r--r--activerecord/test/cases/coders/json_test.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/activerecord/test/cases/coders/json_test.rb b/activerecord/test/cases/coders/json_test.rb
new file mode 100644
index 0000000000..e40d576b39
--- /dev/null
+++ b/activerecord/test/cases/coders/json_test.rb
@@ -0,0 +1,17 @@
+# frozen_string_literal: true
+
+require "cases/helper"
+
+module ActiveRecord
+ module Coders
+ class JSONTest < ActiveRecord::TestCase
+ def test_returns_nil_if_empty_string_given
+ assert_nil JSON.load("")
+ end
+
+ def test_returns_nil_if_nil_given
+ assert_nil JSON.load(nil)
+ end
+ end
+ end
+end