summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authortusooa <tusooa@kazv.moe>2022-12-14 01:04:42 -0500
committertusooa <tusooa@kazv.moe>2022-12-14 01:04:42 -0500
commit62c27e016441d8f0649fea0ea9cfe0646e2b6f11 (patch)
tree5257522288933c4f250712b560a57d6f4f8d26ed /test
parent204fd6faae8c39706a5ded42c7cc4fbc71a733bc (diff)
Fix failure when registering a user with no email when approval required
Diffstat (limited to 'test')
-rw-r--r--test/pleroma/user_test.exs15
1 files changed, 15 insertions, 0 deletions
diff --git a/test/pleroma/user_test.exs b/test/pleroma/user_test.exs
index 303598fad..a58c8f68b 100644
--- a/test/pleroma/user_test.exs
+++ b/test/pleroma/user_test.exs
@@ -591,6 +591,21 @@ defmodule Pleroma.UserTest do
refute_email_sent()
end
+ test "it works when the registering user does not provide an email" do
+ clear_config([Pleroma.Emails.Mailer, :enabled], false)
+ clear_config([:instance, :account_activation_required], false)
+ clear_config([:instance, :account_approval_required], true)
+
+ cng = User.register_changeset(%User{}, @full_user_data |> Map.put(:email, ""))
+
+ # The user is still created
+ assert {:ok, %User{nickname: "nick"}} = User.register(cng)
+
+ # No emails are sent
+ ObanHelpers.perform_all()
+ refute_email_sent()
+ 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)