removing try block in tesla request
added mocks for tests which fail with Tesla.Mock.Error
This commit is contained in:
parent
eb324467d9
commit
f0753eed0f
12 changed files with 139 additions and 22 deletions
|
|
@ -122,6 +122,18 @@ defmodule Pleroma.Web.StreamerTest do
|
|||
test "it sends follow activities to the 'user:notification' stream", %{
|
||||
user: user
|
||||
} do
|
||||
user_url = user.ap_id
|
||||
|
||||
body =
|
||||
File.read!("test/fixtures/users_mock/localhost.json")
|
||||
|> String.replace("{{nickname}}", user.nickname)
|
||||
|> Jason.encode!()
|
||||
|
||||
Tesla.Mock.mock_global(fn
|
||||
%{method: :get, url: ^user_url} ->
|
||||
%Tesla.Env{status: 200, body: body}
|
||||
end)
|
||||
|
||||
user2 = insert(:user)
|
||||
task = Task.async(fn -> assert_receive {:text, _}, @streamer_timeout end)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue