Sha256: 0bbbc4e91114029c053499a04584fb263620409136d549a6523d809cdba28fa1
Contents?: true
Size: 1.48 KB
Versions: 36
Compression:
Stored size: 1.48 KB
Contents
describe Hamlit::Filters::Javascript do describe '#compile' do it 'just renders script tag for empty filter' do assert_render(<<-HAML, <<-HTML) 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) :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 = #{[1, 2]}; HAML <script> var a = [1, 2]; </script> HTML end end end
Version data entries
36 entries across 36 versions & 1 rubygems