spec/rails/spec/requests/faml_spec.rb in faml-0.8.0 vs spec/rails/spec/requests/faml_spec.rb in faml-0.8.1
- old
+ new
@@ -44,9 +44,16 @@
get '/books/escaped'
expect(response).to be_ok
expect(response.body).to include('<marquee>escape me</marquee>')
end
+ it 'escapes html_safe string in attribute values' do
+ get '/books/html_safe_attribute'
+ expect(response).to be_ok
+ html = Nokogiri::HTML.parse(response.body)
+ expect(html.at_css('span')['data-html']).to eq(%q{<b>"don't skip escape"</b>})
+ end
+
describe 'object reference' do
it 'works with new object' do
get '/books/object_ref'
expect(response).to be_ok
expect(response.body).to include("<div class='book' id='book_new'>")