Merge branch 'issue/2069' into 'develop'
[akkoma] / test / pleroma / config / loader_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.LoaderTest do
6 use ExUnit.Case, async: true
7
8 alias Pleroma.Config.Loader
9
10 test "read/1" do
11 config = Loader.read("test/fixtures/config/temp.secret.exs")
12 assert config[:pleroma][:first_setting][:key] == "value"
13 assert config[:pleroma][:first_setting][:key2] == [Pleroma.Repo]
14 assert config[:quack][:level] == :info
15 end
16
17 test "filter_group/2" do
18 assert Loader.filter_group(:pleroma,
19 pleroma: [
20 {Pleroma.Repo, [a: 1, b: 2]},
21 {Pleroma.Upload, [a: 1, b: 2]},
22 {Pleroma.Web.Endpoint, []},
23 env: :test,
24 configurable_from_database: true,
25 database: []
26 ]
27 ) == [{Pleroma.Upload, [a: 1, b: 2]}]
28 end
29 end