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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:26:45+00:00 2026-06-13T11:26:45+00:00

When running following command: bundle exec rspec spec/requests/static_pages_spec.rb i get following errors FF……. Failures:

  • 0

When running following command:

bundle exec rspec spec/requests/static_pages_spec.rb

i get following errors

 FF.......

    Failures:

      1) Static pages Home page should have the h1 'Sample App'
         Failure/Error: page.should have_selector('h1', text: 'Sample App')
           expected css "h1" with text "Sample App" to return something
         # ./spec/requests/static_pages_spec.rb:6:in `block (3 levels) in <top (required)>'

      2) Static pages Home page should have the base title
         Failure/Error: page.should have_selector('title',
           expected css "title" with text "Ruby on Rails Tutorial Sample App" to return something
         # ./spec/requests/static_pages_spec.rb:10:in `block (3 levels) in <top (required)>'

    Finished in 0.38131 seconds
    9 examples, 2 failures

    Failed examples:

    rspec ./spec/requests/static_pages_spec.rb:4 # Static pages Home page should have the h1 'Sample App'
    rspec ./spec/requests/static_pages_spec.rb:8 # Static pages Home page should have the base title

my static_pages_spec.rb looks like this:

require 'spec_helper'
describe "Static pages" do
  describe "Home page" do
    it "should have the h1 'Sample App'" do
      visit root_path
      page.should have_selector('h1', text: 'Sample App')
    end
    it "should have the base title" do
      visit root_path
      page.should have_selector('title',
                        text: "Ruby on Rails Tutorial Sample App")
    end
    it "should not have a custom page title" do
      visit root_path
      page.should_not have_selector('title', text: '| Home')
    end
  end
describe "Help page" do
    it "should have the h1 'Help me'" do
        visit help_path
        page.should have_selector('h1', text: 'Help me')
    end
it "should have the title 'Help me'" do
  visit help_path
   page.should have_selector('title',
                text: "Ruby on Rails Tutorial Sample App | Help me")
end
end
describe "About page" do
  it "should have the h1 'About us'" do
    visit about_path
    page.should have_selector('h1', text: 'About us')
  end
it "should have the title 'About us'" do
  visit about_path
  page.should have_selector('title',
                text: "Ruby on Rails Tutorial Sample App | About us")
    end
  end

  describe "Contact page" do
  it "should have the h1 'Contact'" do
    visit contact_path
    page.should have_selector('h1', text: 'Contact')
  end

it "should have the title 'Contact'" do
  visit contact_path
  page.should have_selector('title',
                text: "Ruby on Rails Tutorial Sample App | Contact")
    end
  end
end

my routes.rb

   SampleApp::Application.routes.draw do
      root to: 'static_pages#home'

      match '/help', to: 'static_pages#help'
      match '/about', to: 'static_pages#about'
      match '/contact', to: 'static_pages#contact'
end

I had 9/9 failures before, but then I added

config.include Rails.application.routes.url_helpers

to the spec/rspec_helper.rb, and now i’m left with the to failures above

  • 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-06-13T11:26:46+00:00Added an answer on June 13, 2026 at 11:26 am

    You need to delete your public/index.html file. Once removed, your code runs fine.

    A way to check what’s going on:

    1. Add gem "launchy" to your Gemfile
    2. bundle
    3. add
      save_and_open_page after your visit root_path
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running this (bundle exec rspec spec/requests/static_pages_spec.rb) worked fine yesterday, but today when I go
When running the following command: rvm install 1.9.3 I get the following output: Error:
I'm running the following command (on Ubuntu) time wget 'http://localhost:8080/upLoading.jsp' --timeout=0 and get a
I get the following output from the sudo bundle install command: Fetching source index
The following is the error message running rspec spec: /factory_girl-2.1.0/lib/factory_girl/registry.rb:38:in `add_as': Already defined: user
I am running the following command from my home directory: python -m CGIHTTPServer This
I am running the following command on Ubuntu: nc -l -p 5004 -v >>
How do you return 0 instead of null when running the following command: SELECT
I am getting the following error after running git svn rebase: 'update-index --refresh: command
When running the rake db:structure:dump command, I encountered the following error: Larson-2:app larson$ rake

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.