res
else
{_, r} = error ->
- Logger.warn(r)
+ #Logger.warn(r)
error
end
end
# GET Requests
#
def get(url, query \\ [], body \\ [], headers \\ [])
+
+ def get("https://osada.macgirvin.com/channel/mike", _, _, _) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!(
+ "test/fixtures/httpoison_mock/https___osada.macgirvin.com_channel_mike.json"
+ )
+ }}
+ end
+
+ def get("https://osada.macgirvin.com/.well-known/webfinger?resource=acct:mike@osada.macgirvin.com", _, _, [Accept: "application/xrd+xml,application/jrd+json"]) do
+ {:ok,
+ %Tesla.Env{
+ status: 200,
+ body: File.read!("test/fixtures/httpoison_mock/mike@osada.macgirvin.com.json")
+ }}
+ end
+
def get("https://social.heldscal.la/.well-known/webfinger?resource=https://social.heldscal.la/user/29191",
_, _, [Accept: "application/xrd+xml,application/jrd+json"]) do
{:ok,
}}
end
- def get("http://gs.example.org:4040/index.php/user/1", _, _, Accept: "application/activity+json") do
- {:ok,
- %Tesla.Env{
- status: 200,
- body: "{\"id\": 1}"
- }}
- end
-
def get("https://squeet.me/xrd/?uri=lain@squeet.me", _, _,
Accept: "application/xrd+xml,application/jrd+json"
) do
alias Pleroma.Web.ActivityPub.{UserView, ObjectView}
alias Pleroma.{Repo, User}
alias Pleroma.Activity
-
+ setup_all do
+ Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
+ :ok
+ end
describe "/relay" do
test "with the relay active, it returns the relay user", %{conn: conn} do
res =
import Pleroma.Factory
import Mock
+ setup_all do
+ Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
+ :ok
+ end
+
test "enqueues an element according to priority" do
queue = [%{item: 1, priority: 2}]