diff options
author | kaniini <nenolod@gmail.com> | 2018-08-16 15:23:04 +0000 |
---|---|---|
committer | kaniini <nenolod@gmail.com> | 2018-08-16 15:23:04 +0000 |
commit | f2fa09c50fde8db4e619872ef6121e90a69324a6 (patch) | |
tree | 4d34037c5fc6d1a3c05a0b061f5279caef1bd671 /test/support/httpoison_mock.ex | |
parent | 718882b326f00c8315bca5acc439b92aa37bf021 (diff) | |
parent | 5fbb14f5ecbbd9feeed2a303c2619fbbba07d70e (diff) | |
download | pleroma-f2fa09c50fde8db4e619872ef6121e90a69324a6.tar.gz pleroma-f2fa09c50fde8db4e619872ef6121e90a69324a6.zip |
Merge branch 'develop' into 'patch-2'
# Conflicts:
# mix.exs
Diffstat (limited to 'test/support/httpoison_mock.ex')
-rw-r--r-- | test/support/httpoison_mock.ex | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/support/httpoison_mock.ex b/test/support/httpoison_mock.ex index befebad8a..527c2e1f7 100644 --- a/test/support/httpoison_mock.ex +++ b/test/support/httpoison_mock.ex @@ -3,6 +3,14 @@ defmodule HTTPoisonMock do def get(url, body \\ [], headers \\ []) + def get("https://puckipedia.com/", [Accept: "application/activity+json"], _) do + {:ok, + %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/puckipedia.com.json") + }} + end + def get( "https://gerzilla.de/.well-known/webfinger?resource=acct:kaniini@gerzilla.de", [Accept: "application/xrd+xml,application/jrd+json"], @@ -736,6 +744,22 @@ defmodule HTTPoisonMock do }} end + def get("https://baptiste.gelez.xyz/~/PlumeDevelopment/this-month-in-plume-june-2018/", _, _) do + {:ok, + %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-article.json") + }} + end + + def get("https://baptiste.gelez.xyz/@/BaptisteGelez", _, _) do + {:ok, + %Response{ + status_code: 200, + body: File.read!("test/fixtures/httpoison_mock/baptiste.gelex.xyz-user.json") + }} + end + def get(url, body, headers) do {:error, "Not implemented the mock response for get #{inspect(url)}, #{inspect(body)}, #{ |