summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/auth_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-03 11:29:39 +0200
committerlain <lain@soykaf.club>2020-09-03 11:29:39 +0200
commitf26b580e80e57f162442e6f0c3bc0072cb935ce3 (patch)
tree3aad914a705da3574c3924c7dc6915965c2e3ad7 /test/web/mastodon_api/controllers/auth_controller_test.exs
parent0a9c63fb4351ed29a521697f2c584b0ae007696c (diff)
parentd1a6f67b1d92e17f4fe3cfc8f296879326897220 (diff)
downloadpleroma-f26b580e80e57f162442e6f0c3bc0072cb935ce3.tar.gz
pleroma-f26b580e80e57f162442e6f0c3bc0072cb935ce3.zip
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into seanking/pleroma-fix_install_fe_bug
Diffstat (limited to 'test/web/mastodon_api/controllers/auth_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/auth_controller_test.exs22
1 files changed, 16 insertions, 6 deletions
diff --git a/test/web/mastodon_api/controllers/auth_controller_test.exs b/test/web/mastodon_api/controllers/auth_controller_test.exs
index a485f8e41..4fa95fce1 100644
--- a/test/web/mastodon_api/controllers/auth_controller_test.exs
+++ b/test/web/mastodon_api/controllers/auth_controller_test.exs
@@ -122,17 +122,27 @@ defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do
{:ok, user: user}
end
- test "it returns 404 when user is not found", %{conn: conn, user: user} do
+ test "it returns 204 when user is not found", %{conn: conn, user: user} do
conn = post(conn, "/auth/password?email=nonexisting_#{user.email}")
- assert conn.status == 404
- assert conn.resp_body == ""
+
+ assert conn
+ |> json_response(:no_content)
end
- test "it returns 400 when user is not local", %{conn: conn, user: user} do
+ test "it returns 204 when user is not local", %{conn: conn, user: user} do
{:ok, user} = Repo.update(Ecto.Changeset.change(user, local: false))
conn = post(conn, "/auth/password?email=#{user.email}")
- assert conn.status == 400
- assert conn.resp_body == ""
+
+ assert conn
+ |> json_response(:no_content)
+ end
+
+ test "it returns 204 when user is deactivated", %{conn: conn, user: user} do
+ {:ok, user} = Repo.update(Ecto.Changeset.change(user, deactivated: true, local: true))
+ conn = post(conn, "/auth/password?email=#{user.email}")
+
+ assert conn
+ |> json_response(:no_content)
end
end