In a Rails 3 application using Steak, Capybara and RSpec how do I test the page\'s title?
I added this to my spec helper:
class Capybara::Session def must_have_title(title="") find('title').native.text.must_have_content(title) end end
Then I can just use:
it 'should have the right title' do page.must_have_title('Expected Title') end