I\'m running through Michael Hartl\'s Rails Tutorial.
I\'m trying to verify the title of my page. The test looks like this:
it \"should have the rig
Controller specs don't normally render the complete view, since they're intended to test controllers in isolation. You can tell Rspec to render the whole page by including the directive integrate_views
at the top of the example group:
describe MyController do
integrate_views
However you should ask yourself if you really want to do this, or if it would make more sense to write view specs.
btw you can also use the CSS3 selector syntax to save a few keystrokes (might need to include the Webrat matchers for this):
response.should have_selector("title:contains('Ruby on Rails Tutorial Sample App | Home')")
EDIT
For Rspec2, replace integrate_views
with render_views