X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fconfig_test.exs;h=438fe62eedf31b004df767dff7d14249a56fdc5c;hb=01da6344b96d74bcb3db5cc73007bf32949f91ca;hp=0a6f0395a1287837433cf0081fe4a115c79ba272;hpb=bee6acd51dc4e84e44caecf9d123dfff2f640a38;p=akkoma
diff --git a/test/config_test.exs b/test/config_test.exs
index 0a6f0395a..438fe62ee 100644
--- a/test/config_test.exs
+++ b/test/config_test.exs
@@ -1,5 +1,5 @@
# Pleroma: A lightweight social networking server
-# Copyright © 2017-2018 Pleroma Authors
+# Copyright © 2017-2019 Pleroma Authors
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.ConfigTest do
@@ -28,6 +28,15 @@ defmodule Pleroma.ConfigTest do
assert Pleroma.Config.get([:azerty, :uiop], true) == true
end
+ test "get/1 when value is false" do
+ Pleroma.Config.put([:instance, :false_test], false)
+ Pleroma.Config.put([:instance, :nested], [])
+ Pleroma.Config.put([:instance, :nested, :false_test], false)
+
+ assert Pleroma.Config.get([:instance, :false_test]) == false
+ assert Pleroma.Config.get([:instance, :nested, :false_test]) == false
+ end
+
test "get!/1" do
assert Pleroma.Config.get!(:instance) == Application.get_env(:pleroma, :instance)
@@ -43,6 +52,15 @@ defmodule Pleroma.ConfigTest do
end)
end
+ test "get!/1 when value is false" do
+ Pleroma.Config.put([:instance, :false_test], false)
+ Pleroma.Config.put([:instance, :nested], [])
+ Pleroma.Config.put([:instance, :nested, :false_test], false)
+
+ assert Pleroma.Config.get!([:instance, :false_test]) == false
+ assert Pleroma.Config.get!([:instance, :nested, :false_test]) == false
+ end
+
test "put/2 with a key" do
Pleroma.Config.put(:config_test, true)