81b49f55bf
* Properly escaped NFO file contents * Added an NFO backfill worker * Added a try-catch to the backfill since I _really_ don't want failures to halt app boot
17 lines
398 B
Elixir
17 lines
398 B
Elixir
defmodule Pinchflat.Utils.XmlUtilsTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Pinchflat.Utils.XmlUtils
|
|
|
|
describe "safe/1" do
|
|
test "escapes invalid characters" do
|
|
assert XmlUtils.safe("hello' & <world>") == "hello' & <world>"
|
|
end
|
|
|
|
test "converts input to string" do
|
|
assert XmlUtils.safe(42) == "42"
|
|
assert XmlUtils.safe(nil) == ""
|
|
end
|
|
end
|
|
end
|