X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=test%2Fconfig_test.exs;h=a46ab43023b14443a802870ad6773a2fe5d4a700;hb=bef34568f0d005baabca266b99ac0f6e620e6899;hp=0a6f0395a1287837433cf0081fe4a115c79ba272;hpb=3c08d229db423052d0dd88b8a36fb39b0ae81ead;p=akkoma
diff --git a/test/config_test.exs b/test/config_test.exs
index 0a6f0395a..a46ab4302 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-2020 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)