Sha256: 7c10a406622089ac36192be5ed600d21a998585b7814e347f0ce294d86058b0b

Contents?: true

Size: 620 Bytes

Versions: 32

Compression:

Stored size: 620 Bytes

Contents

require 'spec_helper'

RSpec.describe 'CoffeeScript filter rendering', type: :render do
  it 'renders CoffeeScript filter' do
    html = render_string(<<HAML)
:coffee
  square = (x) -> x * x
  square(3)
HAML
    expect(html).to include('<script>')
    expect(html).to include('square = function(x)')
    expect(html).to include('square(3)')
  end

  it 'parses string interpolation' do
    html = render_string(<<'HAML')
:coffee
  square = (x) -> x * x
  square(#{1 + 2})
HAML
    expect(html).to include('<script>')
    expect(html).to include('square = function(x)')
    expect(html).to include('square(3)')
  end
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
faml-0.2.9 spec/render/filters/coffee_spec.rb
faml-0.2.8 spec/render/filters/coffee_spec.rb
faml-0.2.7 spec/render/filters/coffee_spec.rb
faml-0.2.6 spec/render/filters/coffee_spec.rb
faml-0.2.5 spec/render/filters/coffee_spec.rb
faml-0.2.4 spec/render/filters/coffee_spec.rb
faml-0.2.3 spec/render/filters/coffee_spec.rb
faml-0.2.2 spec/render/filters/coffee_spec.rb
faml-0.2.1 spec/render/filters/coffee_spec.rb
faml-0.2.0 spec/render/filters/coffee_spec.rb
fast_haml-0.1.10 spec/render/filters/coffee_spec.rb
fast_haml-0.1.9 spec/render/filters/coffee_spec.rb