summaryrefslogtreecommitdiff
path: root/test/tasks/email_test.exs
diff options
context:
space:
mode:
Diffstat (limited to 'test/tasks/email_test.exs')
-rw-r--r--test/tasks/email_test.exs54
1 files changed, 0 insertions, 54 deletions
diff --git a/test/tasks/email_test.exs b/test/tasks/email_test.exs
deleted file mode 100644
index c3af7ef68..000000000
--- a/test/tasks/email_test.exs
+++ /dev/null
@@ -1,54 +0,0 @@
-defmodule Mix.Tasks.Pleroma.EmailTest do
- use Pleroma.DataCase
-
- import Swoosh.TestAssertions
-
- alias Pleroma.Config
- alias Pleroma.Tests.ObanHelpers
-
- setup_all do
- Mix.shell(Mix.Shell.Process)
-
- on_exit(fn ->
- Mix.shell(Mix.Shell.IO)
- end)
-
- :ok
- end
-
- setup do: clear_config([Pleroma.Emails.Mailer, :enabled], true)
-
- describe "pleroma.email test" do
- test "Sends test email with no given address" do
- mail_to = Config.get([:instance, :email])
-
- :ok = Mix.Tasks.Pleroma.Email.run(["test"])
-
- ObanHelpers.perform_all()
-
- assert_receive {:mix_shell, :info, [message]}
- assert message =~ "Test email has been sent"
-
- assert_email_sent(
- to: mail_to,
- html_body: ~r/a test email was requested./i
- )
- end
-
- test "Sends test email with given address" do
- mail_to = "hewwo@example.com"
-
- :ok = Mix.Tasks.Pleroma.Email.run(["test", "--to", mail_to])
-
- ObanHelpers.perform_all()
-
- assert_receive {:mix_shell, :info, [message]}
- assert message =~ "Test email has been sent"
-
- assert_email_sent(
- to: mail_to,
- html_body: ~r/a test email was requested./i
- )
- end
- end
-end