From a237c6a2d4b60a6f15429eb860b995ed2df8d327 Mon Sep 17 00:00:00 2001 From: Alexander Strizhakov Date: Wed, 10 Jul 2019 15:23:25 +0000 Subject: support for idna domains --- test/support/http_request_mock.ex | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'test/support/http_request_mock.ex') diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index c593a5e4a..ff6bb78f9 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -840,6 +840,45 @@ defmodule HttpRequestMock do }} end + def get( + "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=lain@zetsubou.xn--q9jyb4c", + _, + _, + Accept: "application/xrd+xml,application/jrd+json" + ) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/lain.xml") + }} + end + + def get( + "https://zetsubou.xn--q9jyb4c/.well-known/webfinger?resource=https://zetsubou.xn--q9jyb4c/users/lain", + _, + _, + Accept: "application/xrd+xml,application/jrd+json" + ) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/lain.xml") + }} + end + + def get( + "https://zetsubou.xn--q9jyb4c/.well-known/host-meta", + _, + _, + _ + ) do + {:ok, + %Tesla.Env{ + status: 200, + body: File.read!("test/fixtures/host-meta-zetsubou.xn--q9jyb4c.xml") + }} + end + def get(url, query, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{query}, #{inspect(body)}, #{ -- cgit v1.2.3