Get rid of Pleroma.Config in favor of Application
Discussed in https://git.pleroma.social/pleroma/pleroma/merge_requests/426#note_7232
This commit is contained in:
parent
0f6c4635a6
commit
2bc924ba45
7 changed files with 25 additions and 38 deletions
|
|
@ -1,7 +1,6 @@
|
|||
defmodule Pleroma.Web.FederatorTest do
|
||||
alias Pleroma.Web.Federator
|
||||
alias Pleroma.Web.CommonAPI
|
||||
alias Pleroma.Config
|
||||
use Pleroma.DataCase
|
||||
import Pleroma.Factory
|
||||
import Mock
|
||||
|
|
@ -40,8 +39,6 @@ defmodule Pleroma.Web.FederatorTest do
|
|||
activity: activity,
|
||||
relay_mock: relay_mock
|
||||
} do
|
||||
Config.put([:instance, :allow_relay], true)
|
||||
|
||||
with_mocks([relay_mock]) do
|
||||
Federator.handle(:publish, activity)
|
||||
end
|
||||
|
|
@ -53,13 +50,23 @@ defmodule Pleroma.Web.FederatorTest do
|
|||
activity: activity,
|
||||
relay_mock: relay_mock
|
||||
} do
|
||||
Config.put([:instance, :allow_relay], false)
|
||||
instance =
|
||||
Application.get_env(:pleroma, :instance)
|
||||
|> Keyword.put(:allow_relay, false)
|
||||
|
||||
Application.put_env(:pleroma, :instance, instance)
|
||||
|
||||
with_mocks([relay_mock]) do
|
||||
Federator.handle(:publish, activity)
|
||||
end
|
||||
|
||||
refute_received :relay_publish
|
||||
|
||||
instance =
|
||||
Application.get_env(:pleroma, :instance)
|
||||
|> Keyword.put(:allow_relay, true)
|
||||
|
||||
Application.put_env(:pleroma, :instance, instance)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue