Sha256: 62dea7ca59acc953364095237659de6a7112e9daf357b7e7106b978573ac970a

Contents?: true

Size: 514 Bytes

Versions: 4

Compression:

Stored size: 514 Bytes

Contents

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

4 entries across 4 versions & 1 rubygems

Version Path
fast_haml-0.1.3 spec/render/filters/preserve_spec.rb
fast_haml-0.1.2 spec/render/filters/preserve_spec.rb
fast_haml-0.1.1 spec/render/filters/preserve_spec.rb
fast_haml-0.1.0 spec/render/filters/preserve_spec.rb