Sha256: e4853b537b9cf0c4d07e1f639e0a8b800c70bbf217c4dafc1030383ee52e708f
Contents?: true
Size: 1.54 KB
Versions: 48
Compression:
Stored size: 1.54 KB
Contents
require 'helper' describe Temple::HTML::AttributeRemover do before do @remover = Temple::HTML::AttributeRemover.new @disabled_remover = Temple::HTML::AttributeRemover.new :remove_empty_attrs => false end it 'should pass static attributes through' do @remover.call([:html, :tag, 'div', [:html, :attrs, [:html, :attr, 'class', [:static, 'b']]], [:content] ]).should.equal [:html, :tag, "div", [:multi, [:html, :attr, "class", [:static, "b"]]], [:content]] end it 'should check for empty dynamic attribute if :remove_empty_attrs is true' do @remover.call([:html, :tag, 'div', [:html, :attrs, [:html, :attr, 'class', [:dynamic, 'b']]], [:content] ]).should.equal [:html, :tag, "div", [:multi, [:multi, [:capture, "_temple_html_attributeremover1", [:dynamic, "b"]], [:if, "!_temple_html_attributeremover1.empty?", [:html, :attr, "class", [:dynamic, "_temple_html_attributeremover1"]]]]], [:content]] end it 'should not check for empty dynamic attribute if :remove_empty_attrs is false' do @disabled_remover.call([:html, :tag, 'div', [:html, :attrs, [:html, :attr, 'class', [:dynamic, 'b']]], [:content] ]).should.equal [:html, :tag, "div", [:multi, [:html, :attr, "class", [:dynamic, "b"]]], [:content]] end end
Version data entries
48 entries across 48 versions & 2 rubygems