mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-11 03:39:13 +00:00
tests: add tests for Object.normalize()
This commit is contained in:
parent
b3b52b58c3
commit
419d4bd5e4
1 changed files with 18 additions and 0 deletions
|
@ -49,4 +49,22 @@ defmodule Pleroma.ObjectTest do
|
||||||
refute object == cached_object
|
refute object == cached_object
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
describe "normalizer" do
|
||||||
|
test "fetches unknown objects by default" do
|
||||||
|
%Object{} = object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367")
|
||||||
|
|
||||||
|
assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "fetches unknown objects when fetch_remote is explicitly true" do
|
||||||
|
%Object{} = object = Object.normalize("http://mastodon.example.org/@admin/99541947525187367", true)
|
||||||
|
|
||||||
|
assert object.data["url"] == "http://mastodon.example.org/@admin/99541947525187367"
|
||||||
|
end
|
||||||
|
|
||||||
|
test "does not fetch unknown objects when fetch_remote is false" do
|
||||||
|
assert is_nil(Object.normalize("http://mastodon.example.org/@admin/99541947525187367", false))
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue