diff options
author | lain <lain@soykaf.club> | 2020-04-29 13:19:04 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-04-29 13:19:04 +0200 |
commit | 0c491b904d126725866087ad9a51fb6346e2a358 (patch) | |
tree | 652f0d122a25f28681ed28445b5087fb56681067 /test/web/pleroma_api/controllers/account_controller_test.exs | |
parent | 30ea6bb1674482ef6ddbfd8744f9bd878eae91e9 (diff) | |
parent | 58fded9858edbeb318dc011cb313e82a86fbafcb (diff) | |
download | pleroma-0c491b904d126725866087ad9a51fb6346e2a358.tar.gz pleroma-0c491b904d126725866087ad9a51fb6346e2a358.zip |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into remake-remodel-dms
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", %{ |