I cannot get Capybara to work in many of my integration tests.
When I visit certain pages, I get the following html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
And therefore, when I try to use the have_content() selector, it causes the following error:
Failure/Error: page.should have_content("HELLO") Capybara::ElementNotFound: Unable to find xpath "/html"
Some of the pages of my applications that I can visit are just fine, but some others I cannot. There are even some pages that work in some places and not in others:
require 'spec_helper' describe HomeController do it "shows the website description" do visit root_path puts page.html.length
I read in this post that it was a mistake that might occur while using Capybara and webrat. But I do not use webrat at all, and I still get the error ...
Here is my gemfile:
source 'https://rubygems.org' gem 'rails', '3.2.6' gem 'pg' gem 'thin' gem 'devise'
source share