X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;f=test%2Fconfig_test.exs;h=a46ab43023b14443a802870ad6773a2fe5d4a700;hb=906cf53ab94742327d073f56255f695c91339295;hp=0a6f0395a1287837433cf0081fe4a115c79ba272;hpb=b73a1a33de76dc848037a5d0e951866bd21f92c4;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)