diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-09-17 09:32:50 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-09-17 09:32:50 -0500 |
commit | f7e40f7ef134a3030aa61114daa39810efb5889d (patch) | |
tree | 1ee1127690f922c26a144157f82064da2e401b50 /test/tasks/config_test.exs | |
parent | 2a7c9ac14797000735283ef2cdf5cc2240402c41 (diff) | |
download | pleroma-f7e40f7ef134a3030aa61114daa39810efb5889d.tar.gz pleroma-f7e40f7ef134a3030aa61114daa39810efb5889d.zip |
Deny ConfigDB migration when deprecated settings found
Diffstat (limited to 'test/tasks/config_test.exs')
-rw-r--r-- | test/tasks/config_test.exs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/test/tasks/config_test.exs b/test/tasks/config_test.exs index fb12e7fb3..f36648829 100644 --- a/test/tasks/config_test.exs +++ b/test/tasks/config_test.exs @@ -40,6 +40,19 @@ defmodule Mix.Tasks.Pleroma.ConfigTest do on_exit(fn -> Application.put_env(:quack, :level, initial) end) end + @tag capture_log: true + test "config migration refused when deprecated settings are found" do + clear_config([:media_proxy, :whitelist], ["domain_without_scheme.com"]) + assert Repo.all(ConfigDB) == [] + + Mix.Tasks.Pleroma.Config.migrate_to_db("test/fixtures/config/temp.secret.exs") + + assert_received {:mix_shell, :error, [message]} + + assert message =~ + "Migration is not allowed until all deprecation warnings have been resolved." + end + test "filtered settings are migrated to db" do assert Repo.all(ConfigDB) == [] |