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

  • SEARCH
  • Home
  • 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 8112839
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T02:38:41+00:00 2026-06-06T02:38:41+00:00

http://ruby.railstutorial.org/chapters/static-pages#code:pages_controller_spec_title My code is as follows. When uncommented the test wont run. Below is

  • 0

http://ruby.railstutorial.org/chapters/static-pages#code:pages_controller_spec_title

My code is as follows. When uncommented the test wont run. Below is the commented version of the code that allows the defined test to initiate. I don’t know how to format this question with ruby syntax color. Dont yell at me.

require 'spec_helper'

describe "Static Pages" do
  describe "Home page" do
    it "should have the h1 'Sample App'" do
      visit '/static_pages/home'
      page.should have_selector('h1', :text =>'Sample App')  
    end
    it "should have the title 'Home'" do
      visit '/static_pages/home'
      page.should have_selector('title',
       :text => "Ruby on Rails Tutorial Sample App | Home")  
    end   
  end

  describe "Help Page" do
    it "should have the h1 'Help'" do
      visit '/static_pages/help'
      page.should have_selector('h1', :text =>'Help')
    end
    it "should have the title 'Help'" do
      visit '/static_pages/help'
      page.should have_selector('title', 
      :text => "Ruby on Rails Tutorial Sample App | Help")
    end
  end

  describe "About Page" do
    it "should have the h1 'About us'" do
      visit '/static_pages/about'
      page.should have_selector('h1', :text => 'About us')
    end
    it "should have the title 'About us'" do
      visit '/static_pages/about'
      page.should have_selector('title', 
      :text => "Ruby on Rails Tutorial Sample App | About us")
    end  
  end

  # describe 'Contact' do
  #     it "Should have the h1 'Contact'" do
  #       visit "static_pages/contact"
  #       page.should have_selector('h1', :text => 'Contact')
  #     end
  #     it "should have the title 'Contact'"
  #       visit "static_pages/contact"
  #       page.should have_selector('title',
  #       :text => "Ruby on Rails Tutorial Sample App | Contact")
  #     end
  #   end      
end
  • 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-06T02:38:44+00:00Added an answer on June 6, 2026 at 2:38 am

    I guess you forgot do at the end of this line:

     it "should have the title 'Contact'" 
                                           ^ 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following the ruby on rails tutorial: http://railstutorial.org/chapters/static-pages#top I'm up to using rspec. Having
I'm following the Ruby on Rails tutorial at http://ruby.railstutorial.org/chapters/static-pages and came across the following
I'm following http://ruby.railstutorial.org/chapters/following-users#code:from_users_followed_by_final and these tests fails: describe status feed do it should have
http://ruby.railstutorial.org/chapters/following-users?version=3.2 There is a test for User model it { should respond_to(:reverse_relationships) } fails:
In this book: http://ruby.railstutorial.org/chapters/updating-showing-and-deleting-users#code:current_user_p The author does the following: def current_user @current_user ||= User.find_by_remember_token(cookies[:remember_token])
I'm following this tutorial (http://ruby.railstutorial.org/chapters/sign-up#sec:signup_form). However, when code in Listing 7.23 (converted to haml)
I created my authentication from scratch using Hartl's Railstutorial http://ruby.railstutorial.org/chapters/modeling-users#sec:user_model . I want to
I am learning rais from the rails tutorial book: http://ruby.railstutorial.org/chapters/sign-in-sign-out#fnref:9.14 I am working on
I have this syntax in my code, but it displays differently: <a href=http://railstutorial.org/>Ruby on
I'm trying to follow Michael Hartl's Ruby on Rails Tutorial in http://ruby.railstutorial.org/chapters/sign-in-sign-out , but

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.