mirror of
https://git.pleroma.social/sjw/pleroma.git
synced 2024-12-23 19:15:10 +01:00
Merge branch 'transmogrifier-test-errors' into 'develop'
capture test log where errors are expected See merge request pleroma/pleroma!1915
This commit is contained in:
commit
a304a2a845
@ -747,7 +747,10 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
||||
|> Poison.decode!()
|
||||
|> Map.put("actor", ap_id)
|
||||
|
||||
assert :error == Transmogrifier.handle_incoming(data)
|
||||
assert capture_log(fn ->
|
||||
assert :error == Transmogrifier.handle_incoming(data)
|
||||
end) =~ "Object containment failed"
|
||||
|
||||
assert User.get_cached_by_ap_id(ap_id)
|
||||
end
|
||||
|
||||
@ -1437,7 +1440,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
||||
"type" => "Announce"
|
||||
}
|
||||
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
assert capture_log(fn ->
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
end) =~ "Object containment failed"
|
||||
end
|
||||
|
||||
test "it rejects activities which reference objects that have an incorrect attribution (variant 1)" do
|
||||
@ -1450,7 +1455,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
||||
"type" => "Announce"
|
||||
}
|
||||
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
assert capture_log(fn ->
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
end) =~ "Object containment failed"
|
||||
end
|
||||
|
||||
test "it rejects activities which reference objects that have an incorrect attribution (variant 2)" do
|
||||
@ -1463,7 +1470,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
||||
"type" => "Announce"
|
||||
}
|
||||
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
assert capture_log(fn ->
|
||||
:error = Transmogrifier.handle_incoming(data)
|
||||
end) =~ "Object containment failed"
|
||||
end
|
||||
end
|
||||
|
||||
@ -1766,7 +1775,9 @@ defmodule Pleroma.Web.ActivityPub.TransmogrifierTest do
|
||||
|
||||
describe "get_obj_helper/2" do
|
||||
test "returns nil when cannot normalize object" do
|
||||
refute Transmogrifier.get_obj_helper("test-obj-id")
|
||||
assert capture_log(fn ->
|
||||
refute Transmogrifier.get_obj_helper("test-obj-id")
|
||||
end) =~ "Unsupported URI scheme"
|
||||
end
|
||||
|
||||
test "returns {:ok, %Object{}} for success case" do
|
||||
|
Loading…
Reference in New Issue
Block a user