require 'rails_helper'
require 'html_normalize'
describe HtmlNormalize do
def n(html)
HtmlNormalize.normalize(html)
end
it "handles self closing tags" do
source = <<-HTML
boo
HTML
expect(n source).to eq(source.strip)
end
it "Can handle aside" do
source = <<~HTML
HTML
expected = <<~HTML
HTML
expect(n expected).to eq(n source)
end
it "Can normalize attributes" do
source = "b"
same = "b"
expect(n source).to eq(n same)
end
it "Can indent divs nicely" do
source = ""
expected = <<~HTML
HTML
expect(n source).to eq(expected.strip)
end
end