Extract LiveTestHelpers.escape/1
This commit is contained in:
@@ -30,6 +30,7 @@ defmodule MusicLibraryWeb.ConnCase do
|
||||
import MusicLibraryWeb.ConnCase
|
||||
import PhoenixTest
|
||||
import Phoenix.LiveViewTest, only: [render: 1, render_async: 1]
|
||||
import MusicLibraryWeb.LiveTestHelpers
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
defmodule MusicLibraryWeb.LiveTestHelpers do
|
||||
def escape(string) do
|
||||
string
|
||||
|> Phoenix.HTML.html_escape()
|
||||
|> Phoenix.HTML.safe_to_string()
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user