[fix #1014] strip html tags in annotations_privees
This commit is contained in:
parent
6e97209b82
commit
a05217b364
3 changed files with 32 additions and 1 deletions
21
spec/helpers/html_to_string_helper_spec.rb
Normal file
21
spec/helpers/html_to_string_helper_spec.rb
Normal file
|
@ -0,0 +1,21 @@
|
|||
describe HtmlToStringHelper do
|
||||
describe "#html_to_string" do
|
||||
describe 'does not change plain text' do
|
||||
it { expect(helper.html_to_string('text')).to eq('text') }
|
||||
end
|
||||
|
||||
describe 'deals with <br>' do
|
||||
it { expect(helper.html_to_string('new<br>line')).to eq("new\nline") }
|
||||
it { expect(helper.html_to_string('new<br/>line')).to eq("new\nline") }
|
||||
it { expect(helper.html_to_string('new<br />line')).to eq("new\nline") }
|
||||
end
|
||||
|
||||
describe 'deals with <p>' do
|
||||
it { expect(helper.html_to_string('<p>p1</p><p>p2</p>')).to eq("p1\np2\n") }
|
||||
end
|
||||
|
||||
describe 'strip other tags' do
|
||||
it { expect(helper.html_to_string('<i>italic</i>')).to eq('italic') }
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue