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 6813145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:32:09+00:00 2026-05-26T20:32:09+00:00

require ‘spec_helper’ describe LayoutLinks do it should have a Home page at ‘/’ do

  • 0
require 'spec_helper'
describe "LayoutLinks" do
  it "should have a Home page at '/'" do
   get '/'
   response.should have_selector('title', :content => "Home")
 end
end

Spec source: https://github.com/railstutorial/sample_app/blob/master/spec/requests/layout_links_spec.rb
(I’m reading the book)

I tried putting integrate_views and render_views, but it returned an undefined variable error.

$ guard
Guard is now watching at '[project dir]'
Guard::RSpec is running, with RSpec 2!
Running all specs
F

Failures:

  1) LayoutLinks should have a Home page at '/'
     Failure/Error: response.should have_selector('title', :content => "Home")
       expected css "title" to return something
     # ./spec/requests/layout_links_spec.rb:5:in `block (2 levels) in <top (required)>'

Finished in 13.15 seconds
1 example, 1 failure

Failed examples:

rspec ./spec/requests/layout_links_spec.rb:3 # LayoutLinks should have a Home page at '/'

Part of my Gemfile:

gem 'rails', '3.1.0'

group :development, :test do
  gem 'turn', :require => false
  gem 'sqlite3'
  gem "rspec-rails"
  gem "factory_girl_rails"
  gem "capybara"
  gem "guard-rspec"
end

For setting up everything I followed:
http://railscasts.com/episodes/275-how-i-test?view=asciicast

Part of my root directory: Has the title tag and inside “Name of Site | Home”

  • 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-26T20:32:09+00:00Added an answer on May 26, 2026 at 8:32 pm

    Try this:

    response.should have_xpath("//title", :text => "Name of Site | Home")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

require 'rubygems' require 'mechanize' agent = Mechanize.new page = agent.get(http://google.com/) This simple script works
I require one HTML element (Label) on my page to be unselectable for IE
require 'rubygems' require 'xmlsimple' data = XmlSimple.xml_in(<Product><ProductId>12341234</ProductId><Title>Some text here, 11234. and here, 234. and
I require a sliding drawer in my application. It should be placed at the
I require help with respect to class construction. In my class, I have used
I require help with a small Java problem I am having. I have an
require 'mechanize' agent = Mechanize.new login = agent.get('http://www.schoolnet.ch/DE/HomeDE.htm') agent.click login.link_with text: /Login/ And I
We require that in a ASP.Net application, a .Net process should be invoked every
I have a require ment to read data from a table(SQL 2005) and send
require savon client = Savon::Client.new http://www.brenda-enzymes.org/soap2/brenda.wsdl response = client.request (:get_km_value) do |soap| soap.body =

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.