1
0
mirror of https://git.pleroma.social/sjw/pleroma.git synced 2024-11-15 08:37:34 +01:00
pleroma/test/config/holder_test.exs

35 lines
1.2 KiB
Elixir
Raw Normal View History

2020-01-21 15:49:22 +01:00
# Pleroma: A lightweight social networking server
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
2020-01-21 15:49:22 +01:00
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Config.HolderTest do
use ExUnit.Case, async: true
alias Pleroma.Config.Holder
test "default_config/0" do
config = Holder.default_config()
2020-01-21 15:49:22 +01:00
assert config[:pleroma][Pleroma.Uploaders.Local][:uploads] == "test/uploads"
assert config[:tesla][:adapter] == Tesla.Mock
refute config[:pleroma][Pleroma.Repo]
refute config[:pleroma][Pleroma.Web.Endpoint]
refute config[:pleroma][:env]
refute config[:pleroma][:configurable_from_database]
refute config[:pleroma][:database]
refute config[:phoenix][:serve_endpoints]
end
test "default_config/1" do
pleroma_config = Holder.default_config(:pleroma)
2020-01-21 15:49:22 +01:00
assert pleroma_config[Pleroma.Uploaders.Local][:uploads] == "test/uploads"
tesla_config = Holder.default_config(:tesla)
2020-01-21 15:49:22 +01:00
assert tesla_config[:adapter] == Tesla.Mock
end
test "default_config/2" do
assert Holder.default_config(:pleroma, Pleroma.Uploaders.Local) == [uploads: "test/uploads"]
assert Holder.default_config(:tesla, :adapter) == Tesla.Mock
2020-01-21 15:49:22 +01:00
end
end