describe Hamlit::Engine do describe 'new attributes' do it 'renders attributes' do assert_render(<<-HAML, <<-HTML) %p(class='foo') bar HAML

bar

HTML end it 'renders multiple attributes' do assert_render(<<-HAML, <<-HTML) %p(a=1 b=2) bar HAML

bar

HTML end describe 'html escape' do it 'escapes attribute values on static attributes' do assert_render(<<-'HAML', <<-HTML) %a(title="'") %a(title = "'\"") %a(href='/search?foo=bar&hoge=') HAML HTML end it 'escapes attribute values on dynamic attributes' do assert_render(<<-'HAML', <<-HTML) - title = "'\"" - href = '/search?foo=bar&hoge=' %a(title=title) %a(href=href) HAML HTML end end end end