Sha256: b930aa4a190ab94137e5ab11117fcfe92666a63ed235dccf35b5ec341641479d

Contents?: true

Size: 543 Bytes

Versions: 9

Compression:

Stored size: 543 Bytes

Contents

# frozen-string-literal: true
require 'spec_helper'

RSpec.describe 'Preserve filter rendering', type: :render do
  it 'renders preserve filter' do
    expect(render_string(<<'HAML')).to eq("<span>start</span>\nhello&#x000A;  <p>wor&#x000A;ld</p>&#x000A;<span>hello</span>\n<span>end</span>\n")
%span start
:preserve
  hello
    #{"<p>wor\nld</p>"}
  <span>hello</span>
%span end
HAML
  end

  it 'preserves last empty lines' do
    expect(render_string(<<HAML)).to eq("hello&#x000A;&#x000A;\n<p></p>\n")
:preserve
  hello


%p
HAML
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

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