mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 08:36:29 +00:00
AccountControllerTest: Add test for message returned.
This commit is contained in:
parent
dc88b6f091
commit
de3bdc63ad
1 changed files with 22 additions and 7 deletions
|
@ -940,17 +940,32 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do
|
||||||
assert refresh
|
assert refresh
|
||||||
assert scope == "read write follow"
|
assert scope == "read write follow"
|
||||||
|
|
||||||
conn =
|
clear_config([User, :email_blacklist], ["example.org"])
|
||||||
build_conn()
|
|
||||||
|> put_req_header("content-type", "multipart/form-data")
|
params = %{
|
||||||
|> put_req_header("authorization", "Bearer " <> token)
|
|
||||||
|> post("/api/v1/accounts", %{
|
|
||||||
username: "lain",
|
username: "lain",
|
||||||
email: "lain@example.org",
|
email: "lain@example.org",
|
||||||
password: "PlzDontHackLain",
|
password: "PlzDontHackLain",
|
||||||
bio: "Test Bio",
|
bio: "Test Bio",
|
||||||
agreement: true
|
agreement: true
|
||||||
})
|
}
|
||||||
|
|
||||||
|
conn =
|
||||||
|
build_conn()
|
||||||
|
|> put_req_header("content-type", "multipart/form-data")
|
||||||
|
|> put_req_header("authorization", "Bearer " <> token)
|
||||||
|
|> post("/api/v1/accounts", params)
|
||||||
|
|
||||||
|
assert %{"error" => "{\"email\":[\"Email domain is blacklisted\"]}"} =
|
||||||
|
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,
|
"access_token" => token,
|
||||||
|
|
Loading…
Reference in a new issue