Sha256: 05d44e20104a63e2c3c03635d6d45cf4d4bd7ba44f563d9f1f21477cfaba9953

Contents?: true

Size: 593 Bytes

Versions: 26

Compression:

Stored size: 593 Bytes

Contents

require 'spec_helper'

describe Locomotive::Liquid::Tags::Javascript do

  context '#validating syntax' do
    it 'validates a basic syntax' do
      lambda do
        Locomotive::Liquid::Tags::Javascript.new('javascript', '', ["{% endjavascript %}"], {})
      end.should_not raise_error
    end
  end
  
  context '#rendering' do
    template = "{% javascript %}alert('Locomotive rocks!'){% endjavascript %}"
    rendered = "<script type=\"text/javascript\">\n//<![CDATA[\nalert('Locomotive rocks!')\n//]]>\n</script>"
    Liquid::Template.parse(template).render.should == rendered
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
locomotive_cms-2.5.7 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.6 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.6.rc2 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.6.rc1 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.5 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.4 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.3 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.2 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.1 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.0 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.0.rc3 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.0.rc2 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.5.0.rc1 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.4.1 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.4.0 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.3.1 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.3.0 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.2.3 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.2.2 spec/lib/locomotive/liquid/tags/javascript_spec.rb
locomotive_cms-2.2.1 spec/lib/locomotive/liquid/tags/javascript_spec.rb