diff options
author | rinpatch <rinpatch@sdf.org> | 2020-09-08 17:21:12 +0000 |
---|---|---|
committer | rinpatch <rinpatch@sdf.org> | 2020-09-08 17:21:12 +0000 |
commit | 425324aae3d4534bc045466a1cc15653ddfa27d2 (patch) | |
tree | 2d785eb4396e2dc79bb6b0bed5d766b393479dd5 /test/web/mastodon_api/controllers/auth_controller_test.exs | |
parent | 73dd5bdb7dcdf804bdbabcf632671d4de5042ebc (diff) | |
parent | 073f5490ece616fd9602382c1be1347457cbbe79 (diff) |
Merge branch 'release/2.1.1' into 'stable'v2.1.1
2.1.1 release
See merge request pleroma/secteam/pleroma!13
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 |