diff options
author | lain <lain@soykaf.club> | 2020-04-22 15:04:26 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-22 15:04:26 +0200 |
commit | 5b3952619818d38f8fdba9a64b050ce3f24394ff (patch) | |
tree | e2c574d22927742a9134f5610d0b9542b66583a7 /test | |
parent | 69ecc3903800685e87eb11cd6063b525aa968316 (diff) | |
download | pleroma-5b3952619818d38f8fdba9a64b050ce3f24394ff.tar.gz |
AccountController: Use code 400 for self-follow.
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/controllers/account_controller_test.exs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/web/mastodon_api/controllers/account_controller_test.exs b/test/web/mastodon_api/controllers/account_controller_test.exs index 61c2697b2..8c428efee 100644 --- a/test/web/mastodon_api/controllers/account_controller_test.exs +++ b/test/web/mastodon_api/controllers/account_controller_test.exs @@ -681,17 +681,17 @@ defmodule Pleroma.Web.MastodonAPI.AccountControllerTest do test "following / unfollowing errors", %{user: user, conn: conn} do # self follow conn_res = post(conn, "/api/v1/accounts/#{user.id}/follow") - assert %{"error" => "Record not found"} = json_response(conn_res, 404) + assert %{"error" => "Can not follow yourself"} = json_response(conn_res, 400) # self unfollow user = User.get_cached_by_id(user.id) conn_res = post(conn, "/api/v1/accounts/#{user.id}/unfollow") - assert %{"error" => "Record not found"} = json_response(conn_res, 404) + assert %{"error" => "Can not unfollow yourself"} = json_response(conn_res, 400) # self follow via uri user = User.get_cached_by_id(user.id) conn_res = post(conn, "/api/v1/follows", %{"uri" => user.nickname}) - assert %{"error" => "Record not found"} = json_response(conn_res, 404) + assert %{"error" => "Can not follow yourself"} = json_response(conn_res, 400) # follow non existing user conn_res = post(conn, "/api/v1/accounts/doesntexist/follow") |