From 763756f8790809d593c34dc78196d241d230658a Mon Sep 17 00:00:00 2001 From: Roger Braun Date: Fri, 4 Aug 2017 16:57:38 +0200 Subject: Also fetch atom links. --- test/support/httpoison_mock.ex | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'test/support') diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex index 420d42a0d..08b566fcd 100644 --- a/test/support/httpoison_mock.ex +++ b/test/support/httpoison_mock.ex @@ -87,6 +87,13 @@ defmodule HTTPoisonMock do }} end + def get("https://social.sakamoto.gq/users/eal/feed.atom", _body, _headers) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/sakamoto_eal_feed.atom") + }} + end + def get("http://gs.example.org/index.php/api/statuses/user_timeline/1.atom", _body, _headers) do {:ok, %Response{ status_code: 200, @@ -142,6 +149,13 @@ defmodule HTTPoisonMock do }} end + def get("https://social.sakamoto.gq/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://social.sakamoto.gq/users/eal"]]) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/eal_sakamoto.xml") + }} + end + def get("https://mamot.fr/users/Skruyb.atom", _, _) do {:ok, %Response{ status_code: 200, @@ -149,6 +163,14 @@ defmodule HTTPoisonMock do }} end + def get("https://social.sakamoto.gq/objects/0ccc1a2c-66b0-4305-b23a-7f7f2b040056", [Accept: "application/atom+xml"], _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/sakamoto.atom") + }} + + end + def get(url, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"} end -- cgit v1.2.3