1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
5 defmodule Pleroma.Emails.MailerTest do
7 alias Pleroma.Emails.Mailer
9 import Swoosh.TestAssertions
12 from: {"Pleroma", "noreply@example.com"},
13 html_body: "Test email",
14 subject: "Pleroma test email",
15 to: [{"Test User", "user1@example.com"}]
18 clear_config([Pleroma.Emails.Mailer, :enabled])
20 test "not send email when mailer is disabled" do
21 Pleroma.Config.put([Pleroma.Emails.Mailer, :enabled], false)
22 Mailer.deliver(@email)
25 from: {"Pleroma", "noreply@example.com"},
26 to: [{"Test User", "user1@example.com"}],
27 html_body: "Test email",
28 subject: "Pleroma test email"
33 Mailer.deliver(@email)
36 from: {"Pleroma", "noreply@example.com"},
37 to: [{"Test User", "user1@example.com"}],
38 html_body: "Test email",
39 subject: "Pleroma test email"
44 Mailer.perform(:deliver_async, @email, [])
47 from: {"Pleroma", "noreply@example.com"},
48 to: [{"Test User", "user1@example.com"}],
49 html_body: "Test email",
50 subject: "Pleroma test email"