Sha256: 6b4c039b30f330365f30d7429fa5e932f46c89bee820cf077f6861aa12283aec

Contents?: true

Size: 650 Bytes

Versions: 9

Compression:

Stored size: 650 Bytes

Contents

# frozen-string-literal: true
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

9 entries across 9 versions & 1 rubygems

Version Path
faml-0.7.3 spec/render/filters/coffee_spec.rb
faml-0.7.2 spec/render/filters/coffee_spec.rb
faml-0.7.1 spec/render/filters/coffee_spec.rb
faml-0.7.0 spec/render/filters/coffee_spec.rb
faml-0.6.5 spec/render/filters/coffee_spec.rb
faml-0.6.4 spec/render/filters/coffee_spec.rb
faml-0.6.3 spec/render/filters/coffee_spec.rb
faml-0.6.2 spec/render/filters/coffee_spec.rb
faml-0.6.1 spec/render/filters/coffee_spec.rb