diff options
author | Roger Braun <roger@rogerbraun.net> | 2017-05-10 18:46:23 +0200 |
---|---|---|
committer | Roger Braun <roger@rogerbraun.net> | 2017-05-10 18:46:23 +0200 |
commit | 05f2cd0d930e93d1eb80a8a4ba3952f8ba46f5ce (patch) | |
tree | 752c9bddc7ccfbf738439a8b9ea4ead878d4c7c2 /test/support | |
parent | 34a1ce00ecc6f19827638fc311e4e76d3c4cb162 (diff) | |
download | pleroma-05f2cd0d930e93d1eb80a8a4ba3952f8ba46f5ce.tar.gz |
Handle incoming follows.
Also Mastodon CWs.
Diffstat (limited to 'test/support')
-rw-r--r-- | test/support/httpoison_mock.ex | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex index 733abced2..0eff336ab 100644 --- a/test/support/httpoison_mock.ex +++ b/test/support/httpoison_mock.ex @@ -16,7 +16,7 @@ defmodule HTTPoisonMock do body: File.read!("test/fixtures/httpoison_mock/shp@social.heldscal.la.xml") }} end - + def get("https://social.heldscal.la/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://social.heldscal.la/user/23211"]]) do {:ok, %Response{ status_code: 200, @@ -115,8 +115,28 @@ defmodule HTTPoisonMock do }} end + def post("https://social.heldscal.la/main/push/hub", {:form, data}, ["Content-type": "application/x-www-form-urlencoded"]) do + {:ok, %Response{ + status_code: 202 + }} + end + + def get("https://pawoo.net/.well-known/webfinger", [Accept: "application/xrd+xml"], [params: [resource: "https://pawoo.net/users/pekorino"]]) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.xml") + }} + end + + def get("https://pawoo.net/users/pekorino.atom", _, _) do + {:ok, %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/https___pawoo.net_users_pekorino.atom") + }} + end + def get(url, body, headers) do - {:error, "Not implemented the mock response for get #{inspect(url)}"} + {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{inspect(headers)}"} end def post(url, body, headers) do |