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 right title" do
get 'home'
response.should have_selector("title", :content => "Ruby on Rails Tutorial Sample App | Home")
end
The HTML head section looks like this
<head>
<title>Ruby on Rails Tutorial Sample App | Home</title>
</head>
I'm getting the following failure
1) PagesController GET 'home' should have the right title Failure/Error: response.should have_selector("title", :content => "Ruby on Rails Tutorial Sample App | Home") expected following output to contain a Ruby on Rails Tutorial Sample App | Home tag: # ./spec/controllers/pages_controller_spec.rb:13:in `block (3 levels) in '
I'm expecting this to pass. What am I doing wrong? I'm using Rails 3 and RSpec 2.0.0