Fork of Pleroma with site-specific changes and feature branches https://git.pleroma.social/pleroma/pleroma
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 lines
397B

  1. defmodule Pleroma.SafeJsonbSetTest do
  2. use Pleroma.DataCase
  3. test "it doesn't wipe the object when asked to set the value to NULL" do
  4. assert %{rows: [[%{"key" => "value", "test" => nil}]]} =
  5. Ecto.Adapters.SQL.query!(
  6. Pleroma.Repo,
  7. "select safe_jsonb_set('{\"key\": \"value\"}'::jsonb, '{test}', NULL);",
  8. []
  9. )
  10. end
  11. end