diff options
| author | lain <lain@soykaf.club> | 2020-01-28 17:52:42 +0100 | 
|---|---|---|
| committer | lain <lain@soykaf.club> | 2020-01-28 17:52:42 +0100 | 
| commit | cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e (patch) | |
| tree | dfc1a2b2bb27d845bbde24b023287122f5d39ed7 /test/web/mastodon_api/controllers/suggestion_controller_test.exs | |
| parent | ae78059ff433739b83aaa3ccff9245ace153146d (diff) | |
| parent | e8f22451da18aeba9bcf9f9f6acf93690ccb3cba (diff) | |
| download | pleroma-cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e.tar.gz pleroma-cedee2793d96b0384a3041ea0a6cd1f2b1c3dd1e.zip | |
Merge branch 'develop' of git.pleroma.social:pleroma/pleroma into features/remote-follow-userpage-redirect
Diffstat (limited to 'test/web/mastodon_api/controllers/suggestion_controller_test.exs')
| -rw-r--r-- | test/web/mastodon_api/controllers/suggestion_controller_test.exs | 46 | 
1 files changed, 1 insertions, 45 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..0319d3475 100644 --- a/test/web/mastodon_api/controllers/suggestion_controller_test.exs +++ b/test/web/mastodon_api/controllers/suggestion_controller_test.exs @@ -7,7 +7,6 @@ defmodule Pleroma.Web.MastodonAPI.SuggestionControllerTest do    alias Pleroma.Config -  import ExUnit.CaptureLog    import Pleroma.Factory    import Tesla.Mock @@ -36,11 +35,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 +43,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 | 
