im working on ruby.railstutorial.org/ruby-on-rails-tutorial-book. Im using rails 3.2.7, spork, rspec, capybara, launchy and some guards :)
i have a really weird problem
For the moment the easiest way to do this is to access the Title element from the page html, this will return the title:
page.html.match(/(.*)<\/title>/)[1].to_s
Not ideal as it's a using a regex on html(!!) but will work. Probably best to write a helper function
# put in spec/support/utilities.rb
def page_title(page)
page.html.match(/(.*)<\/title>/)[1].to_s
end
then your tests can be written as
page_title(page).should eq( "Ruby on Rails Tutorial Sample App | Home" }