jkotests / watir-nokogiri

MIT License
10 stars 1 forks source link

Nokogiri changes the charset attribute value #2

Open jkotests opened 11 years ago

jkotests commented 11 years ago

See failing spec - https://github.com/jkotests/watir-nokogiri/blob/master/spec/watirspec/browser_spec.rb#L23-L46

describe "#html" do
  bug "#html changes charset", :watir_nokogiri do
    it "returns the DOM of the page as an HTML string" do
      browser.goto(WatirSpec.url_for("right_click.html"))
      html = browser.html.downcase # varies between browsers

      html.should =~ /^<html/
      html.should include('<meta ')
      html.should include(' content="text/html; charset=utf-8"')

      not_compliant_on :internet_explorer do
        html.should include(' http-equiv="content-type"')
      end

      deviates_on :internet_explorer9, :internet_explorer10 do
        html.should include(' http-equiv="content-type"')
      end

      not_compliant_on :internet_explorer9, :internet_explorer10 do
        deviates_on :internet_explorer do
          html.should include(' http-equiv=content-type')
        end
      end
    end
  end
end

This fails due to the "charset" value being changed by nokogiri.