diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-01 06:21:59 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2020-05-01 06:21:59 +0300 |
commit | a92c713d9c761563c72d0f660574878aa569249a (patch) | |
tree | ce88697749dbe26331b255883b4fa9631002e8b4 /test/web/pleroma_api/controllers/account_controller_test.exs | |
parent | 270c3fe446a374202b6d64ce487f7df29ecb1c14 (diff) | |
parent | 0dd863f8f53d30d37e35d4ec2c4e34d09a266a85 (diff) | |
download | pleroma-a92c713d9c761563c72d0f660574878aa569249a.tar.gz pleroma-a92c713d9c761563c72d0f660574878aa569249a.zip |
Merge branch 'develop' into issue/1276-2
Diffstat (limited to 'test/web/pleroma_api/controllers/account_controller_test.exs')
-rw-r--r-- | test/web/pleroma_api/controllers/account_controller_test.exs | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/test/web/pleroma_api/controllers/account_controller_test.exs b/test/web/pleroma_api/controllers/account_controller_test.exs index ae5334015..6b671a667 100644 --- a/test/web/pleroma_api/controllers/account_controller_test.exs +++ b/test/web/pleroma_api/controllers/account_controller_test.exs @@ -151,15 +151,18 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do assert like["id"] == activity.id end - test "does not return favorites for specified user_id when user is not logged in", %{ + test "returns favorites for specified user_id when requester is not logged in", %{ user: user } do activity = insert(:note_activity) CommonAPI.favorite(user, activity.id) - build_conn() - |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") - |> json_response(403) + response = + build_conn() + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(200) + + assert length(response) == 1 end test "returns favorited DM only when user is logged in and he is one of recipients", %{ @@ -185,9 +188,12 @@ defmodule Pleroma.Web.PleromaAPI.AccountControllerTest do assert length(response) == 1 end - build_conn() - |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") - |> json_response(403) + response = + build_conn() + |> get("/api/v1/pleroma/accounts/#{user.id}/favourites") + |> json_response(200) + + assert length(response) == 0 end test "does not return others' favorited DM when user is not one of recipients", %{ |