diff options
author | Mark Felder <feld@FreeBSD.org> | 2020-09-03 10:34:06 -0500 |
---|---|---|
committer | Mark Felder <feld@FreeBSD.org> | 2020-09-03 10:34:06 -0500 |
commit | 85446cc30c97a326d90b4ef719ba2e54c2ad423f (patch) | |
tree | caa8e1268cbab2a09e414b85d2ce52b24249d0da /test/web/mastodon_api/controllers/auth_controller_test.exs | |
parent | 6ce28c409137972ee9b105b9d7ab4a0fd2a0d08b (diff) | |
parent | 9433311923d4b41b057ce6cb1632ff27d46919b4 (diff) | |
download | pleroma-85446cc30c97a326d90b4ef719ba2e54c2ad423f.tar.gz pleroma-85446cc30c97a326d90b4ef719ba2e54c2ad423f.zip |
Merge branch 'develop' into media-preview-proxy
Diffstat (limited to 'test/web/mastodon_api/controllers/auth_controller_test.exs')
-rw-r--r-- | test/web/mastodon_api/controllers/auth_controller_test.exs | 22 |
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 |