Merge branch 'fix/follow-and-blocks-import' into 'develop'
[akkoma] / test / config / holder_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Config.HolderTest do
6 use ExUnit.Case, async: true
7
8 alias Pleroma.Config.Holder
9
10 test "default_config/0" do
11 config = Holder.default_config()
12 assert config[:pleroma][Pleroma.Uploaders.Local][:uploads] == "test/uploads"
13 assert config[:tesla][:adapter] == Tesla.Mock
14
15 refute config[:pleroma][Pleroma.Repo]
16 refute config[:pleroma][Pleroma.Web.Endpoint]
17 refute config[:pleroma][:env]
18 refute config[:pleroma][:configurable_from_database]
19 refute config[:pleroma][:database]
20 refute config[:phoenix][:serve_endpoints]
21 end
22
23 test "default_config/1" do
24 pleroma_config = Holder.default_config(:pleroma)
25 assert pleroma_config[Pleroma.Uploaders.Local][:uploads] == "test/uploads"
26 tesla_config = Holder.default_config(:tesla)
27 assert tesla_config[:adapter] == Tesla.Mock
28 end
29
30 test "default_config/2" do
31 assert Holder.default_config(:pleroma, Pleroma.Uploaders.Local) == [uploads: "test/uploads"]
32 assert Holder.default_config(:tesla, :adapter) == Tesla.Mock
33 end
34 end