diff options
author | kaniini <ariadne@dereferenced.org> | 2019-07-20 13:07:51 +0000 |
---|---|---|
committer | kaniini <ariadne@dereferenced.org> | 2019-07-20 13:07:51 +0000 |
commit | 6e99e7c774d5e8b6e881810c506cfd9dce2a6107 (patch) | |
tree | 92cfb97528c1998534f5404ca1f4fe8f081e3ce1 /test/web/mastodon_api | |
parent | 93df0796f05eff382301de91fb268bb4bc3c3379 (diff) | |
parent | 43a7cd27feb6ef52e4b130a974af3f819a9b266d (diff) | |
download | pleroma-6e99e7c774d5e8b6e881810c506cfd9dce2a6107.tar.gz |
Merge branch 'tests/mock-sha512-crypt' into 'develop'
[tests] Mock :crypt.crypt/2 function in AuthenticationPlugTest
Closes #1114
See merge request pleroma/pleroma!1455
Diffstat (limited to 'test/web/mastodon_api')
-rw-r--r-- | test/web/mastodon_api/search_controller_test.exs | 34 |
1 files changed, 20 insertions, 14 deletions
diff --git a/test/web/mastodon_api/search_controller_test.exs b/test/web/mastodon_api/search_controller_test.exs index 9f50c09f4..043b96c14 100644 --- a/test/web/mastodon_api/search_controller_test.exs +++ b/test/web/mastodon_api/search_controller_test.exs @@ -24,12 +24,16 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do {Pleroma.User, [], [search: fn _q, _o -> raise "Oops" end]}, {Pleroma.Activity, [], [search: fn _u, _q, _o -> raise "Oops" end]} ] do - conn = get(conn, "/api/v2/search", %{"q" => "2hu"}) - - assert results = json_response(conn, 200) - - assert results["accounts"] == [] - assert results["statuses"] == [] + capture_log(fn -> + results = + conn + |> get("/api/v2/search", %{"q" => "2hu"}) + |> json_response(200) + + assert results["accounts"] == [] + assert results["statuses"] == [] + end) =~ + "[error] Elixir.Pleroma.Web.MastodonAPI.SearchController search error: %RuntimeError{message: \"Oops\"}" end end @@ -99,14 +103,16 @@ defmodule Pleroma.Web.MastodonAPI.SearchControllerTest do {Pleroma.User, [], [search: fn _q, _o -> raise "Oops" end]}, {Pleroma.Activity, [], [search: fn _u, _q, _o -> raise "Oops" end]} ] do - conn = - conn - |> get("/api/v1/search", %{"q" => "2hu"}) - - assert results = json_response(conn, 200) - - assert results["accounts"] == [] - assert results["statuses"] == [] + capture_log(fn -> + results = + conn + |> get("/api/v1/search", %{"q" => "2hu"}) + |> json_response(200) + + assert results["accounts"] == [] + assert results["statuses"] == [] + end) =~ + "[error] Elixir.Pleroma.Web.MastodonAPI.SearchController search error: %RuntimeError{message: \"Oops\"}" end end |