diff --git a/spec/layout_spec.cr b/spec/layout_spec.cr index 0069eb4..2433188 100644 --- a/spec/layout_spec.cr +++ b/spec/layout_spec.cr @@ -23,19 +23,37 @@ module ToHtml::LayoutSpec end end + class MyScript + ToHtml.class_template do + script do + <<-JS + console.log("Hello World!"); + JS + end + end + end + class MyId ToHtml.class_tag_attrs do id = "the-id" end end + class OtherAttrs + ToHtml.class_tag_attrs do + style = "background-color: red;" + end + end + class MyLayout < Layout getter something : Something delegate :window_title, to: something add_to_head MyStyle + add_to_head MyScript body_attributes MyId + body_attributes OtherAttrs ToHtml.instance_template do super do @@ -60,8 +78,11 @@ module ToHtml::LayoutSpec background-color: #EEEEEE; } + -
+