diff options
author | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-01-27 13:21:50 +0000 |
---|---|---|
committer | Haelwenn <contact+git.pleroma.social@hacktivis.me> | 2020-01-27 13:21:50 +0000 |
commit | b12f3064730648de992f934cf5a23cadb5206b9d (patch) | |
tree | edaa519452d9008660e5aa4dd8464506ba806828 /test | |
parent | 0b582d415ba5215495047ddae1cb4e4fc1e016e6 (diff) | |
parent | dabd535e436789e64f6630460bfadd2f49dcf069 (diff) | |
download | pleroma-b12f3064730648de992f934cf5a23cadb5206b9d.tar.gz pleroma-b12f3064730648de992f934cf5a23cadb5206b9d.zip |
Merge branch 'remove/suggestions-third-party-engine' into 'develop'
Remove user recommendation by third party engine
See merge request pleroma/pleroma!2141
Diffstat (limited to 'test')
-rw-r--r-- | test/web/mastodon_api/controllers/suggestion_controller_test.exs | 45 |
1 files changed, 1 insertions, 44 deletions
diff --git a/test/web/mastodon_api/controllers/suggestion_controller_test.exs b/test/web/mastodon_api/controllers/suggestion_controller_test.exs index c4118a576..c288c2fff 100644 --- a/test/web/mastodon_api/controllers/suggestion_controller_test.exs +++ b/test/web/mastodon_api/controllers/suggestion_controller_test.exs @@ -36,11 +36,7 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do [other_user: other_user] end - clear_config(:suggestions) - - test "returns empty result when suggestions disabled", %{conn: conn} do - Config.put([:suggestions, :enabled], false) - + test "returns empty result", %{conn: conn} do res = conn |> get("/api/v1/suggestions") @@ -48,43 +44,4 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do assert res == [] end - - test "returns error", %{conn: conn} do - Config.put([:suggestions, :enabled], true) - Config.put([:suggestions, :third_party_engine], "http://test500?{{host}}&{{user}}") - - assert capture_log(fn -> - res = - conn - |> get("/api/v1/suggestions") - |> json_response(500) - - assert res == "Something went wrong" - end) =~ "Could not retrieve suggestions" - end - - test "returns suggestions", %{conn: conn, other_user: other_user} do - Config.put([:suggestions, :enabled], true) - Config.put([:suggestions, :third_party_engine], "http://test200?{{host}}&{{user}}") - - res = - conn - |> get("/api/v1/suggestions") - |> json_response(200) - - assert res == [ - %{ - "acct" => "yj455", - "avatar" => "https://social.heldscal.la/avatar/201.jpeg", - "avatar_static" => "https://social.heldscal.la/avatar/s/201.jpeg", - "id" => 0 - }, - %{ - "acct" => other_user.ap_id, - "avatar" => "https://social.heldscal.la/avatar/202.jpeg", - "avatar_static" => "https://social.heldscal.la/avatar/s/202.jpeg", - "id" => other_user.id - } - ] - end end |