aboutsummaryrefslogtreecommitdiff
path: root/test/safe_jsonb_set_test.exs
diff options
context:
space:
mode:
authorEgor Kislitsyn <egor@kislitsyn.com>2019-10-21 14:19:15 +0700
committerEgor Kislitsyn <egor@kislitsyn.com>2019-10-21 14:19:15 +0700
commit4ea1a61b008c932bc83fcd6cd07bb7f4c251204a (patch)
treec763bd3a2a21ee3e40384ee323076bbb577b7ccb /test/safe_jsonb_set_test.exs
parent8ad015ef64e0d2a4cd9f2979ff08d28be3a635e5 (diff)
parent62e3d76a450c1b34ba8d0c88a184ec861ed90f29 (diff)
downloadpleroma-4ea1a61b008c932bc83fcd6cd07bb7f4c251204a.tar.gz
Merge branch 'develop' into refactor/following-relationships
Diffstat (limited to 'test/safe_jsonb_set_test.exs')
-rw-r--r--test/safe_jsonb_set_test.exs12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/safe_jsonb_set_test.exs b/test/safe_jsonb_set_test.exs
new file mode 100644
index 000000000..748540570
--- /dev/null
+++ b/test/safe_jsonb_set_test.exs
@@ -0,0 +1,12 @@
+defmodule Pleroma.SafeJsonbSetTest do
+ use Pleroma.DataCase
+
+ test "it doesn't wipe the object when asked to set the value to NULL" do
+ assert %{rows: [[%{"key" => "value", "test" => nil}]]} =
+ Ecto.Adapters.SQL.query!(
+ Pleroma.Repo,
+ "select safe_jsonb_set('{\"key\": \"value\"}'::jsonb, '{test}', NULL);",
+ []
+ )
+ end
+end