diff options
author | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-04 16:39:08 +0300 |
---|---|---|
committer | Maksim Pechnikov <parallel588@gmail.com> | 2018-12-04 17:44:15 +0300 |
commit | 5c6d47614dfd72566a91ac58223902e71ebdf1d3 (patch) | |
tree | 0b6a65b72f764aa822d45c79b5eff6c2b3905474 /test/support/http_request_mock.ex | |
parent | a9e4a975866c33553c477667c431187590329447 (diff) | |
download | pleroma-5c6d47614dfd72566a91ac58223902e71ebdf1d3.tar.gz pleroma-5c6d47614dfd72566a91ac58223902e71ebdf1d3.zip |
all tests passed
Diffstat (limited to 'test/support/http_request_mock.ex')
-rw-r--r-- | test/support/http_request_mock.ex | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/test/support/http_request_mock.ex b/test/support/http_request_mock.ex index 80b84d591..c1b1c8589 100644 --- a/test/support/http_request_mock.ex +++ b/test/support/http_request_mock.ex @@ -14,7 +14,7 @@ defmodule HttpRequestMock do res else {_, r} = error -> - Logger.warn(r) + #Logger.warn(r) error end end @@ -22,6 +22,25 @@ defmodule HttpRequestMock do # 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, @@ -90,14 +109,6 @@ defmodule HttpRequestMock do }} 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 |