Since version 2.1.0 is capybara, there are methods for working with the header in the session. You
page.title page.has_title? "my title" page.has_no_title? "my not found title"
So you can check the name, for example:
expect(page).to have_title "my_title"
According to github.com/jnicklas/capybara/issues/863 , also works with capybara 2.0 :
expect(first('title').native.text).to eq "my title"
Lars Schirrmeister Jan 03 '13 at 13:24 2013-01-03 13:24
source share