summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMark Felder <feld@feld.me>2021-02-04 17:56:46 -0600
committerMark Felder <feld@feld.me>2021-02-04 17:56:46 -0600
commitc3614403966ddddeddecd45d97fdda8f2879cd32 (patch)
tree77fe596d702f9da64c0b44b6e0958fcb26cb3bc6 /test
parent95930a7aa5b06ded61a2694989531846a527d0ed (diff)
Add basic test to validate the registration email is dispatched when the others are disabled
Also only check for subject as the body is a mess of html and we don't really need to prove its contents if the subject matches.
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/user_test.exs20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
index be39339f3..86f050fd1 100644
--- a/test/pleroma/user_test.exs
+++ b/test/pleroma/user_test.exs
@@ -551,6 +551,26 @@ defmodule Pleroma.UserTest do
)
end
+ test "it sends a registration confirmed email if no others will be sent" do
+ clear_config([:welcome, :email, :enabled], false)
+ clear_config([:instance, :account_activation_required], false)
+ clear_config([:instance, :account_approval_required], false)
+
+ {:ok, user} =
+ User.register_changeset(%User{}, @full_user_data)
+ |> User.register()
+ ObanHelpers.perform_all()
+
+ instance_name = Pleroma.Config.get([:instance, :name])
+ sender = Pleroma.Config.get([:instance, :notify_email])
+
+ assert_email_sent(
+ from: {instance_name, sender},
+ to: {user.name, user.email},
+ subject: "Account registered on #{instance_name}"
+ )
+ end
+
test "it requires an email, name, nickname and password, bio is optional when account_activation_required is enabled" do
clear_config([:instance, :account_activation_required], true)