summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorLain Soykaf <lain@lain.com>2023-12-12 15:25:52 +0400
committerLain Soykaf <lain@lain.com>2023-12-12 15:25:52 +0400
commitdca41cc4a37999a6971b70ef5e0996e528b79bf5 (patch)
treecbc4804b8e129afc34e098c141f50674b894b0a8 /test
parentb13820dcd078c78cc89974ff0d06cff1ed5c99dc (diff)
downloadpleroma-dca41cc4a37999a6971b70ef5e0996e528b79bf5.tar.gz
pleroma-dca41cc4a37999a6971b70ef5e0996e528b79bf5.zip
EmailTest: use config mock
Diffstat (limited to 'test')
-rw-r--r--test/mix/tasks/pleroma/email_test.exs17
1 files changed, 13 insertions, 4 deletions
diff --git a/test/mix/tasks/pleroma/email_test.exs b/test/mix/tasks/pleroma/email_test.exs
index 20b76ae3a..8682ee85d 100644
--- a/test/mix/tasks/pleroma/email_test.exs
+++ b/test/mix/tasks/pleroma/email_test.exs
@@ -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