diff options
| author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-04-22 15:33:04 +0000 | 
|---|---|---|
| committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-04-22 15:33:04 +0000 | 
| commit | 468cc977be3d4a00760861efb34aa931c84defbb (patch) | |
| tree | e5720ec95dcc96ed2c7684f192e6c5e88e1df887 /test/web | |
| parent | 238058ecaed4ed5102b610d423247e3f4000f26b (diff) | |
| parent | 5b3952619818d38f8fdba9a64b050ce3f24394ff (diff) | |
| download | pleroma-468cc977be3d4a00760861efb34aa931c84defbb.tar.gz pleroma-468cc977be3d4a00760861efb34aa931c84defbb.zip  | |
Merge branch 'bugfix/following-fix-status-code' into 'develop'
AccountController: Use code 400 for self-follow.
Closes #1674
See merge request pleroma/pleroma!2413
Diffstat (limited to 'test/web')
| -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")  | 
