5150a93e38
- requires the development branch of live_view currently, if you are going to be using live view ci Docs Raise minimum elixir version to 1.9 There is some bug in EEx that was fixed in 1.9 and I can't be bothered to make it backwards compatible with the bug. ugh Remove commented out line
24 lines
596 B
Elixir
24 lines
596 B
Elixir
defmodule Temple.Parser.UtilsTest do
|
|
use ExUnit.Case, async: true
|
|
|
|
alias Temple.Parser.Utils
|
|
|
|
describe "runtime_attrs/1" do
|
|
test "compiles keyword lists and maps into html attributes" do
|
|
attrs_map = %{
|
|
class: "text-red",
|
|
id: "form1",
|
|
inner_block: %{}
|
|
}
|
|
|
|
attrs_kw = [
|
|
class: "text-red",
|
|
id: "form1",
|
|
inner_block: %{}
|
|
]
|
|
|
|
assert {:safe, ~s| class="text-red" id="form1"|} == Utils.runtime_attrs(attrs_map)
|
|
assert {:safe, ~s| class="text-red" id="form1"|} == Utils.runtime_attrs(attrs_kw)
|
|
end
|
|
end
|
|
end
|