Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6104241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T13:49:10+00:00 2026-05-23T13:49:10+00:00

I am following the Ruby on Rails Tutorial for Rails 3, located here: http://ruby.railstutorial.org

  • 0

I am following the Ruby on Rails Tutorial for Rails 3, located here:

http://ruby.railstutorial.org

I am at this section of the tutorial:

http://ruby.railstutorial.org/chapters/filling-in-the-layout#sec:integration_tests

All of my pages render as expected at this point; e.g., I can hit http://localhost:3000/about and see the about page of the sample application, with the expected title (“Ruby on Rails Tutorial Sample App | About”). Yet the integration tests from this section keep failing.

Here is my layout_links_spec.rb:

require 'spec_helper'

describe "LayoutLinks" do

  it "should have a Home page at '/'" do
    get '/'
    response should have_selector('title', :content => "Home")
  end

  it "should have a Contact page at '/contact'" do
    get '/contact'
    response should have_selector('title', :content => "Contact")
  end

  it "should have an About page at '/about'" do 
    get '/about'
    response should have_selector('title', :content => "About")
  end

  it "should have a Help page at '/help'" do
    get '/help'
    response should have_selector('title', :content => "Help")
  end
end

When I run tests with rspec spec/ or via autotest, I get the following test failures:

    ........FFFF

    Failures:

      1) LayoutLinks should have a Home page at '/'
         Failure/Error: response should have_selector('title', :content => "Home")
           expected following output to contain a <title>Home</title> tag:
           <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
           <html><body><p>LayoutLinks</p></body></html>
         # ./spec/requests/layout_links_spec.rb:7:in `block (2 levels) in <top (required)>'

      2) LayoutLinks should have a Contact page at '/contact'
         Failure/Error: response should have_selector('title', :content => "Contact")
           expected following output to contain a <title>Contact</title> tag:
           <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
           <html><body><p>LayoutLinks</p></body></html>
         # ./spec/requests/layout_links_spec.rb:12:in `block (2 levels) in <top (required)>'

      3) LayoutLinks should have an About page at '/about'
         Failure/Error: response should have_selector('title', :content => "About")
           expected following output to contain a <title>About</title> tag:
           <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
           <html><body><p>LayoutLinks</p></body></html>
         # ./spec/requests/layout_links_spec.rb:17:in `block (2 levels) in <top (required)>'

      4) LayoutLinks should have a Help page at '/help'
         Failure/Error: response should have_selector('title', :content => "Help")
           expected following output to contain a <title>Help</title> tag:
           <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
           <html><body><p>LayoutLinks</p></body></html>
         # ./spec/requests/layout_links_spec.rb:22:in `block (2 levels) in <top (required)>'

    Finished in 0.23497 seconds
    12 examples, 4 failures

    Failed examples:

    rspec ./spec/requests/layout_links_spec.rb:5 # LayoutLinks should have a Home page at '/'
    rspec ./spec/requests/layout_links_spec.rb:10 # LayoutLinks should have a Contact page at '/contact'
    rspec ./spec/requests/layout_links_spec.rb:15 # LayoutLinks should have an About page at '/about'
    rspec ./spec/requests/layout_links_spec.rb:20 # LayoutLinks should have a Help page at '/help'

…note that the response shown in the test failures appears to indicate that I’m getting a mock/stubbed response. I believe that this is my issue, but I don’t know why it is happening.

Finally, here is my environment:

Gatito:sample_app abrown$ gem list

    *** LOCAL GEMS ***

    abstract (1.0.0)
    actionmailer (3.0.9)
    actionpack (3.0.9)
    activemodel (3.0.9)
    activerecord (3.0.9)
    activeresource (3.0.9)
    activesupport (3.0.9)
    arel (2.0.10)
    autotest (4.4.6)
    autotest-fsevent (0.2.4)
    autotest-growl (0.2.9)
    autotest-rails-pure (4.1.2)
    builder (2.1.2)
    bundler (1.0.15)
    configuration (1.2.0)
    diff-lcs (1.1.2)
    erubis (2.6.6)
    heroku (2.3.3)
    i18n (0.5.0)
    launchy (0.4.0)
    mail (2.2.19)
    mime-types (1.16)
    nokogiri (1.4.6)
    polyglot (0.3.1)
    rack (1.2.3)
    rack-mount (0.6.14)
    rack-test (0.5.7)
    rails (3.0.9)
    railties (3.0.9)
    rake (0.9.2, 0.8.7)
    rdoc (3.6.1)
    rest-client (1.6.3)
    rspec (2.6.0)
    rspec-core (2.6.4)
    rspec-expectations (2.6.0)
    rspec-mocks (2.6.0)
    rspec-rails (2.6.1)
    sequel (3.20.0)
    sinatra (1.0)
    spork (0.9.0.rc8)
    sqlite3 (1.3.3)
    sqlite3-ruby (1.3.3)
    sys-uname (0.8.5)
    taps (0.3.23)
    term-ansicolor (1.0.5)
    thor (0.14.6)
    treetop (1.4.9)
    tzinfo (0.3.28)
    webrat (0.7.1)
    ZenTest (4.5.0)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T13:49:11+00:00Added an answer on May 23, 2026 at 1:49 pm

    I figured it out. I typed in the tests above myself. When I re-copied/pasted the tests directly from the tutorial, they began passing. I was mystified, as everything looked identical at a glance. But after running a diff, I realized that for each test, I had typed:

    response should
    

    …but that I should have typed:

    # Note the "."
    response.should
    

    After making this correction to each test, they all pass as expected.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am following a Ruby on Rails tutorial, http://ruby.railstutorial.org/chapters/filling-in-the-layout#top and I am stuck at
I'm following the rails tutorial here: http://railstutorial.org/chapters/filling-in-the-layout#top When I run rspec spec/, I get
I'm following the Ruby on Rails tutorial at http://railstutorial.org/chapters/beginning#sec:1.4.1 , and all is going
I'm following Ruby on Rails Tutorial: Learn Rails by Example, by Michael Hartl. http://ruby.railstutorial.org/chapters/a-demo-app#sec:a_micropost_microtour
I am following Michael Hartl's Rails Tutorial Here: http://ruby.railstutorial.org/chapters/modeling-and-viewing-users-one#top I use this command to
I'm following the ruby on rails tutorial: http://railstutorial.org/chapters/static-pages#top I'm up to using rspec. Having
I'm new to rails and working my way into the tutorial here: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book I've
I am following the Ruby on Rails Tutorial (http://ruby.railstutorial.org) . In Chapter 3, the
I am following the Ruby on Rails tutorial by Michael Hartl http://ruby.railstutorial.org/ I installed
I'm following this tutorial (seems good) for Rails. After I run ruby script/generate scaffold

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.