diff options
author | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-09 20:09:56 +0300 |
---|---|---|
committer | Ivan Tashkinov <ivantashkinov@gmail.com> | 2019-08-09 20:09:56 +0300 |
commit | 267262491ecf7b413052708062abac69b1d8f643 (patch) | |
tree | 0d4d1f6c10766f49ad98e61fab36934b2e30706b /test/web/admin_api/admin_api_controller_test.exs | |
parent | b7fad8d395c2bd1afe445a370e539571f5ec0c18 (diff) | |
parent | 29807ef6a5b43a528ffca08b4f721b251f331c8d (diff) | |
download | pleroma-267262491ecf7b413052708062abac69b1d8f643.tar.gz pleroma-267262491ecf7b413052708062abac69b1d8f643.zip |
Merge remote-tracking branch 'remotes/upstream/develop' into 1149-oban-job-queue
Diffstat (limited to 'test/web/admin_api/admin_api_controller_test.exs')
-rw-r--r-- | test/web/admin_api/admin_api_controller_test.exs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/web/admin_api/admin_api_controller_test.exs b/test/web/admin_api/admin_api_controller_test.exs index 824ad23e6..bcbc18639 100644 --- a/test/web/admin_api/admin_api_controller_test.exs +++ b/test/web/admin_api/admin_api_controller_test.exs @@ -1914,6 +1914,38 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do ] } end + + test "delete part of settings by atom subkeys", %{conn: conn} do + config = + insert(:config, + key: "keyaa1", + value: :erlang.term_to_binary(subkey1: "val1", subkey2: "val2", subkey3: "val3") + ) + + conn = + post(conn, "/api/pleroma/admin/config", %{ + configs: [ + %{ + group: config.group, + key: config.key, + subkeys: [":subkey1", ":subkey3"], + delete: "true" + } + ] + }) + + assert( + json_response(conn, 200) == %{ + "configs" => [ + %{ + "group" => "pleroma", + "key" => "keyaa1", + "value" => [%{"tuple" => [":subkey2", "val2"]}] + } + ] + } + ) + end end describe "config mix tasks run" do @@ -1922,7 +1954,10 @@ defmodule Pleroma.Web.AdminAPI.AdminAPIControllerTest do temp_file = "config/test.exported_from_db.secret.exs" + Mix.shell(Mix.Shell.Quiet) + on_exit(fn -> + Mix.shell(Mix.Shell.IO) :ok = File.rm(temp_file) end) |