Sha256: b25527d8399251568af2fd4bd0e8573b6c16e6c7b3119a3dffd07cdc123f4d0a
Contents?: true
Size: 1.52 KB
Versions: 17
Compression:
Stored size: 1.52 KB
Contents
describe Hamlit::Filters::Javascript do describe '#compile' do it 'just renders script tag for empty filter' do assert_render(<<-HAML, <<-HTML, compatible_only: []) before :javascript after HAML before <script> </script> after HTML end it 'compiles javascript filter' do assert_render(<<-HAML, <<-HTML) before :javascript alert('hello'); after HAML before <script> alert('hello'); </script> after HTML end it 'accepts illegal indentation' do assert_render(<<-HAML, <<-HTML, compatible_only: :faml) :javascript if { alert('hello'); } :javascript if { alert('hello'); } HAML <script> if { alert('hello'); } </script> <script> if { alert('hello'); } </script> HTML end it 'accepts illegal indentation' do assert_render(<<-HAML, <<-HTML) :javascript if { alert('a'); } HAML <script> if { alert('a'); } </script> HTML end it 'parses string interpolation' do assert_render(<<-'HAML', <<-HTML) :javascript var a = "#{'<&>'}"; HAML <script> var a = "<&>"; </script> HTML end end end
Version data entries
17 entries across 17 versions & 1 rubygems