mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-19 03:19:17 +00:00
test: add tests for new User.html_filter_policy()
This commit is contained in:
parent
df00a364fb
commit
bd03644ca8
|
@ -526,4 +526,18 @@ test "insert or update a user from given data" do
|
|||
|
||||
assert {:ok, %User{}} = User.insert_or_update_user(data)
|
||||
end
|
||||
|
||||
describe "per-user rich-text filtering" do
|
||||
test "html_filter_policy returns nil when rich-text is enabled" do
|
||||
user = insert(:user)
|
||||
|
||||
assert nil == User.html_filter_policy(user)
|
||||
end
|
||||
|
||||
test "html_filter_policy returns TwitterText scrubber when rich-text is disabled" do
|
||||
user = insert(:user, %{info: %{"no_rich_text" => true}})
|
||||
|
||||
assert Pleroma.HTML.Scrubber.TwitterText == User.html_filter_policy(user)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue