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
|
|
@ -110,6 +110,15 @@ defmodule Pleroma.Web.ActivityPub.MRF.AntiLinkSpamPolicyTest do
|
|||
end
|
||||
|
||||
describe "with unknown actors" do
|
||||
setup do
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :get, url: "http://invalid.actor"} ->
|
||||
%Tesla.Env{status: 500, body: ""}
|
||||
end)
|
||||
|
||||
:ok
|
||||
end
|
||||
|
||||
test "it rejects posts without links" do
|
||||
message =
|
||||
@linkless_message
|
||||
|
|
|
|||
|
|
@ -89,6 +89,11 @@ defmodule Pleroma.Web.ActivityPub.RelayTest do
|
|||
}
|
||||
)
|
||||
|
||||
Tesla.Mock.mock(fn
|
||||
%{method: :get, url: "http://mastodon.example.org/eee/99541947525187367"} ->
|
||||
%Tesla.Env{status: 500, body: ""}
|
||||
end)
|
||||
|
||||
assert capture_log(fn ->
|
||||
assert Relay.publish(activity) == {:error, nil}
|
||||
end) =~ "[error] error: nil"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue