saving to DB only added by user settings

This commit is contained in:
Alexander Strizhakov 2020-01-17 11:45:44 +03:00
commit 60ba2339a2
No known key found for this signature in database
GPG key ID: 022896A53AEF1381
11 changed files with 280 additions and 44 deletions

View file

@ -47,6 +47,35 @@ defmodule Pleroma.Config.TransferTaskTest do
end)
end
test "transfer config values for 1 group and some keys" do
level = Application.get_env(:quack, :level)
meta = Application.get_env(:quack, :meta)
ConfigDB.create(%{
group: ":quack",
key: ":level",
value: :info
})
ConfigDB.create(%{
group: ":quack",
key: ":meta",
value: [:none]
})
Pleroma.Config.TransferTask.start_link([])
assert Application.get_env(:quack, :level) == :info
assert Application.get_env(:quack, :meta) == [:none]
default = Pleroma.Config.Holder.config(:quack, :webhook_url)
assert Application.get_env(:quack, :webhook_url) == default
on_exit(fn ->
Application.put_env(:quack, :level, level)
Application.put_env(:quack, :meta, meta)
end)
end
test "non existing atom" do
ConfigDB.create(%{
group: ":pleroma",