require 'spec_helper' describe HtmlHelper, type: :helper do describe "stripping html from a string" do it "strips tags" do expect(helper.strip_html('
Hello world!
')).to eq("Hello world!") end it "removes nbsp and amp entities" do expect(helper.strip_html('Hello world&&')).to eq('Hello world&&') end it "returns nil for nil input" do expect(helper.strip_html(nil)).to be_nil end describe "line breaks" do it "adds two line breaks after heading tags" do expect(helper.strip_html("foo
bar")).to eq("foo\n\nbar"); end it "adds two line breaks after div tags" do expect(helper.strip_html("