EmailTest: use config mock
This commit is contained in:
parent
b13820dcd0
commit
dca41cc4a3
4 changed files with 19 additions and 6 deletions
|
|
@ -3,13 +3,15 @@
|
|||
# SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
defmodule Mix.Tasks.Pleroma.EmailTest do
|
||||
use Pleroma.DataCase
|
||||
use Pleroma.DataCase, async: true
|
||||
|
||||
import Swoosh.TestAssertions
|
||||
|
||||
alias Pleroma.Config
|
||||
alias Pleroma.Test.StaticConfig, as: Config
|
||||
alias Pleroma.Tests.ObanHelpers
|
||||
alias Pleroma.UnstubbedConfigMock, as: ConfigMock
|
||||
|
||||
import Mox
|
||||
import Pleroma.Factory
|
||||
|
||||
setup_all do
|
||||
|
|
@ -22,8 +24,15 @@ defmodule Mix.Tasks.Pleroma.EmailTest do
|
|||
:ok
|
||||
end
|
||||
|
||||
setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
|
||||
setup do: clear_config([:instance, :account_activation_required], true)
|
||||
setup do
|
||||
ConfigMock
|
||||
|> stub(:get, fn
|
||||
[Pleroma.Emails.Mailer, :enabled] -> true
|
||||
[:instance, :account_activation_required] -> true
|
||||
end)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
describe "pleroma.email test" do
|
||||
test "Sends test email with no given address" do
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue