summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/account_controller_test.exs
diff options
context:
space:
mode:
authorAngelina Filippova <linakirsanova@gmail.com>2020-08-07 21:05:44 +0300
committerAngelina Filippova <linakirsanova@gmail.com>2020-08-07 21:05:44 +0300
commitf21b6ebd5d71b77b1f2b7c8918005c3b70752c15 (patch)
tree7beddc568e0e1430ab6bc8fdbc4c6d9d04744d49 /test/web/mastodon_api/controllers/account_controller_test.exs
parent8e1f7a3eff05a43f59f15dc6fa0483713e221fa7 (diff)
parent8e90cc58e7ec3f19f03d049ff541750f1ab4774e (diff)
downloadpleroma-f21b6ebd5d71b77b1f2b7c8918005c3b70752c15.tar.gz
pleroma-f21b6ebd5d71b77b1f2b7c8918005c3b70752c15.zip
Merge branch 'feature/update-welcome-setting-in-description' of git.pleroma.social:pleroma/pleroma into feature/update-welcome-setting-in-description
Diffstat (limited to 'test/web/mastodon_api/controllers/account_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/account_controller_test.exs29
1 files changed, 22 insertions, 7 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs
index d390c3ce1..17a1e7d66 100644
--- a/test/web/mastodon_api/controllers/account_controller_test.exs
+++ b/test/web/mastodon_api/controllers/account_controller_test.exs
@@ -940,17 +940,32 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
assert refresh
assert scope == "read write follow"
+ clear_config([User, :email_blacklist], ["example.org"])
+
+ params = %{
+ username: "lain",
+ email: "lain@example.org",
+ password: "PlzDontHackLain",
+ bio: "Test Bio",
+ agreement: true
+ }
+
conn =
build_conn()
|> put_req_header("content-type", "multipart/form-data")
|> put_req_header("authorization", "Bearer " <> token)
- |> post("/api/v1/accounts", %{
- username: "lain",
- email: "lain@example.org",
- password: "PlzDontHackLain",
- bio: "Test Bio",
- agreement: true
- })
+ |> post("/api/v1/accounts", params)
+
+ assert %{"error" => "{\"email\":[\"Invalid email\"]}"} =
+ json_response_and_validate_schema(conn, 400)
+
+ Pleroma.Config.put([User, :email_blacklist], [])
+
+ conn =
+ build_conn()
+ |> put_req_header("content-type", "multipart/form-data")
+ |> put_req_header("authorization", "Bearer " <> token)
+ |> post("/api/v1/accounts", params)
%{
"access_token" => token,