projects
/
akkoma
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
39e9965
)
Add a test for safe_jsonb_set
author
rinpatch
<rinpatch@sdf.org>
Fri, 18 Oct 2019 11:33:51 +0000
(14:33 +0300)
committer
rinpatch
<rinpatch@sdf.org>
Fri, 18 Oct 2019 12:22:16 +0000
(15:22 +0300)
test/safe_jsonb_set_test.exs
[new file with mode: 0644]
patch
|
blob
diff --git a/test/safe_jsonb_set_test.exs
b/test/safe_jsonb_set_test.exs
new file mode 100644
(file)
index 0000000..
7485405
--- /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