diff options
author | lain <lain@soykaf.club> | 2019-11-05 15:21:00 +0100 |
---|---|---|
committer | lain <lain@soykaf.club> | 2019-11-05 15:21:00 +0100 |
commit | 1bd1f62af55e01613e6362661b36a19091c87424 (patch) | |
tree | 519963a50af82c1a0b251f1405d663ba9ccd4714 /test/safe_jsonb_set_test.exs | |
parent | faced6236b9e2ce9675cf743068f16098b744562 (diff) | |
parent | f11eebc18383be7d7b4b037582e4e1e08b74653b (diff) | |
download | pleroma-1bd1f62af55e01613e6362661b36a19091c87424.tar.gz pleroma-1bd1f62af55e01613e6362661b36a19091c87424.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel
Diffstat (limited to 'test/safe_jsonb_set_test.exs')
-rw-r--r-- | test/safe_jsonb_set_test.exs | 12 |
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 |