1
0
Fork 1
mirror of https://akkoma.dev/AkkomaGang/akkoma.git synced 2024-11-17 18:49:15 +00:00
akkoma/test/pleroma/user/user_search_test.exs
2022-12-06 10:57:10 +00:00

23 lines
616 B
Elixir

defmodule Pleroma.User.SearchTest do
use Pleroma.DataCase
describe "sanitise_domain/1" do
test "should remove url-reserved characters" do
examples = [
["example.com", "example.com"],
["no spaces", "nospaces"],
["no@at", "noat"],
["dash-is-ok", "dash-is-ok"],
["underscore_not_so_much", "underscorenotsomuch"],
["no!", "no"],
["no?", "no"],
["a$b%s^o*l(u)t'e#l<y n>o/t", "absolutelynot"]
]
for [input, expected] <- examples do
assert Pleroma.User.Search.sanitise_domain(input) == expected
end
end
end
end