Mock HTTPoison in testing.

This commit is contained in:
Roger Braun 2017-05-05 14:16:54 +02:00
commit d982f04a65
19 changed files with 2527 additions and 9 deletions

View file

@ -1,4 +1,5 @@
defmodule Pleroma.Web.WebFinger do
@httpoison Application.get_env(:pleroma, :httpoison)
alias Pleroma.{Repo, User, XmlBuilder}
alias Pleroma.Web
@ -81,7 +82,7 @@ defmodule Pleroma.Web.WebFinger do
{:ok, data}
end
def finger(account, getter \\ &HTTPoison.get/3) do
def finger(account, getter \\ &@httpoison.get/3) do
domain = with [_name, domain] <- String.split(account, "@") do
domain
else _e ->