jnicklas/capybara — Issue #597: HTML includes XML declaration and DOCTYPE on 64 bits Ruby, and breaks spec
Author: gaizka
Created: 2012-01-08 12:28:13+00:00
State: open

Hi there!

This is a duplicate of issue https://github.com/jnicklas/capybara/issues/570 , but I am attaching a failing spec and I'll try to explain why I think this is a real issue.

I've attached a failing spec here: https://gist.github.com/1578175

In that issue, @jnicklas closes the issue telling that browsers won't bother about that.

The problem is that because of Nokogiri (or Capybara interacting with it, i am not sure where is the real problem) inserts that xml declaration, Capybara parsing breaks and some of my specs are failing.

Every spec where we test that we have some content, and this content contains accented characters (áéíóú), or where we test that we have a html tag (for example, ) that with the xml declaration get converted to .

The attached spec works properly in my laptop (capybara 1.1.1, nokogiri 1.5.0, rack 1.2,5, rack-test 0.5.7, ruby 1.9.2p180), but fails in my CI server (same version of every gem, ruby, etc, only difference is that is a 64 bit machine).

I'll try to find the problem.