mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
18 lines
442 B
Ruby
18 lines
442 B
Ruby
require 'spec_helper'
|
|
|
|
describe HtmlHelper do
|
|
describe "stripping html from a string" do
|
|
it "strips tags" do
|
|
helper.strip_html('<p><b>Hello</b> <em>world</em>!</p>').should == 'Hello world!'
|
|
end
|
|
|
|
it "removes nbsp and amp entities" do
|
|
helper.strip_html('Hello world&&').should == 'Hello world&&'
|
|
end
|
|
|
|
it "returns nil for nil input" do
|
|
helper.strip_html(nil).should be_nil
|
|
end
|
|
end
|
|
end
|