summaryrefslogtreecommitdiff
path: root/test/web/mastodon_api/controllers/auth_controller_test.exs
diff options
context:
space:
mode:
authorlain <lain@soykaf.club>2020-09-23 09:16:00 +0000
committerlain <lain@soykaf.club>2020-09-23 09:16:00 +0000
commita6c14041c49df0dc850204723cfc1f242ded8aa2 (patch)
tree559fe96b7f65cd750a4bab5e9a117c43829c800f /test/web/mastodon_api/controllers/auth_controller_test.exs
parent518c0f2962ab36660157d7cbc995d1f4562728b3 (diff)
parent34235bc02a88718b1d5a9d7fa2437784b91bb692 (diff)
downloadpleroma-a6c14041c49df0dc850204723cfc1f242ded8aa2.tar.gz
pleroma-a6c14041c49df0dc850204723cfc1f242ded8aa2.zip
Merge branch 'develop' into 'issue/1975'
# Conflicts: # CHANGELOG.md
Diffstat (limited to 'test/web/mastodon_api/controllers/auth_controller_test.exs')
-rw-r--r--test/web/mastodon_api/controllers/auth_controller_test.exs15
1 files changed, 6 insertions, 9 deletions
diff --git a/test/web/mastodon_api/controllers/auth_controller_test.exs b/test/web/mastodon_api/controllers/auth_controller_test.exs
index 4fa95fce1..bf2438fe2 100644
--- a/test/web/mastodon_api/controllers/auth_controller_test.exs
+++ b/test/web/mastodon_api/controllers/auth_controller_test.exs
@@ -61,7 +61,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do
end
test "it returns 204", %{conn: conn} do
- assert json_response(conn, :no_content)
+ assert empty_json_response(conn)
end
test "it creates a PasswordResetToken record for user", %{user: user} do
@@ -91,7 +91,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do
assert conn
|> post("/auth/password?nickname=#{user.nickname}")
- |> json_response(:no_content)
+ |> empty_json_response()
ObanHelpers.perform_all()
token_record = Repo.get_by(Pleroma.PasswordResetToken, user_id: user.id)
@@ -112,7 +112,7 @@ defmodule Pleroma.Web.MastodonAPI.AuthControllerTest do
assert conn
|> post("/auth/password?nickname=#{user.nickname}")
- |> json_response(:no_content)
+ |> empty_json_response()
end
end
@@ -125,24 +125,21 @@ defmodule Pleroma.Web.MastodonAPI.AuthControllerTest 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
- |> json_response(:no_content)
+ assert empty_json_response(conn)
end
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
- |> json_response(:no_content)
+ assert empty_json_response(conn)
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)
+ assert empty_json_response(conn)
end
end