Trying to test that page contains
with:
# spec/features/reports_spec.rb
require \'spec_helper\'
feature \"A
I know this has an accepted answer already, but for what it's worth, you can do the following, in less lines of code:
title = first("head title").native.text
expect(title).to == "What you expect it to match"
This allows access to the native driver element; further, since Capybara 2.0 ignores invisible text (title is invisible except to the browser), you would need this (or a similar workaround) to satisfy this case. (See https://github.com/jnicklas/capybara/issues/863)