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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T21:00:25+00:00 2026-05-11T21:00:25+00:00

I’m following along with RailsSpace: Building a Social Networking Website with Ruby on Rails

  • 0

I’m following along with RailsSpace: Building a Social Networking Website with Ruby on Rails by Michael Hartl. Running rails v2.3.2.

I’ve gotten to the 5th chapter in which testing is introduced. The following is supposed to match the title of the various pages to strings using the get method:

require File.dirname(__FILE__) + '/../test_helper' 
require 'site_controller' 

    # Re-raise errors caught by the controller. 
    class SiteController; def rescue_action(e) raise e end; end 

    class SiteControllerTest < Test::Unit::TestCase 
      def setup 
        @controller = SiteController.new 
        @request     = ActionController::TestRequest.new 
        @response   = ActionController::TestResponse.new 
      end 

      def test_index 
        get :index
        title = assigns(:title) 
        assert_equal "Welcome to RailsSpace!", title 
        assert_response :success 
        assert_template "index" 
        end 

      def test_about 
        get :title
        title = assigns(:title) 
        assert_equal "About RailsSpace", title 
        assert_response :success 
        assert_template "about" 
      end 

      def test_help 
        get :help
        title = assigns(:title) 
        assert_equal "RailsSpace Help", title 
        assert_response :success 
        assert_template "help" 
      end 
    end 

On compiling I get:

Loaded suite site_controller_test
Started
EEE
Finished in 0.057 seconds.

  1) Error:
test_about(SiteControllerTest):
NoMethodError: undefined method `get' for #<SiteControllerTest:0x4854b30>
    site_controller_test.rb:23:in `test_about'

  2) Error:
test_help(SiteControllerTest):
NoMethodError: undefined method `get' for #<SiteControllerTest:0x4854b1c>
    site_controller_test.rb:31:in `test_help'

  3) Error:
test_index(SiteControllerTest):
NoMethodError: undefined method `get' for #<SiteControllerTest:0x485470c>
    site_controller_test.rb:15:in `test_index'

3 tests, 0 assertions, 0 failures, 3 errors

Other people have had this issue and the only proposed solution is just to reinstall. I’m not to enthused by this. Since this is an older book there this is probably just breakage between rails versions. What would be the equivalent of this for rails v2.3.2?

  • 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-11T21:00:25+00:00Added an answer on May 11, 2026 at 9:00 pm

    Replace all the following code

    # Re-raise errors caught by the controller. 
    class SiteController; def rescue_action(e) raise e end; end 
    
    class SiteControllerTest < Test::Unit::TestCase 
      def setup 
        @controller = SiteController.new 
        @request     = ActionController::TestRequest.new 
        @response   = ActionController::TestResponse.new 
      end
    

    with

    class SiteControllerTest < ActionController::TestCase
    

    The code you are using refers to Rails 2.0/2.1.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have just tried to save a simple *.rtf file with some websites and
In order to apply a triggered animation to all ToolTip s in my app,
Basically, what I'm trying to create is a page of div tags, each has

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.