Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions spec/plugins/dom_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,16 @@ class DomTest
body do
div do
ul class: 'list' do
li "Two\nLines"
li {}
end
end
end
end
}

dom.find('li:first-child').save! :multiline_html
dom.find('li:last-child').save! :inline_html, false
dom.save! :html, false
end unless RUBY_ENGINE == 'opal'
end
Expand Down Expand Up @@ -73,6 +76,19 @@ class DomTest
expect(ul.attr('foo')).to eq 'bar'
expect(ul.attr('number')).to eq '1'
end

it 'should allow to use a 1 line html as template' do
multiline_li = subject.dom.tmpl(:multiline_html)
multiline_li.find('li').append '<span>works</span>'
dom.find('ul').append multiline_li
expect(dom.find('li').length).to eq 2
expect(dom.find('li span').length).to eq 1

inline_li = subject.dom.tmpl(:inline_html)
inline_li.find('li').append '<span>bug here</span>'
dom.find('ul').append inline_li
expect(dom.find('li span').length).to eq 2
end
end
end
end