SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)

    Error in the March 2007 corrections (pg 230)

    I noticed an error in the March 2007 correction listing and thought it might cause some grief for anyone going through the book. This has to do with the functional tests in chapter 7.

    The listing was correct in the book however it is shown in the corrections page as follows:

    Code:
    def test_should_redirect_after_vote_with_get
      get :vote, :id => 2
      assert_redirected_to :action => 'show',
          :id => 'sitepoint-forums'
    end
    Will throw an error because :id is not a string but 'sitepoint-forums' is. It's a number. The correct listing is as follows (same as in the book):

    Code:
    def test_should_redirect_after_vote_with_get
          get :vote, :id => 2
          assert_redirected_to :action => 'show', 
                :permalink => 'sitepoint-forums'
      end
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development

  2. #2
    SitePoint Zealot atetlaw's Avatar
    Join Date
    Feb 2007
    Location
    Melbourne, Australia
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi Andrew,

    Thanks for pointing that out. It's been fixed now.

    Also, we've recently made a significant update to the errata page and I highly recommend checking it out and downloading the code archive again.

    Of course if you have any problems please let us know.

    Cheers,
    Andrew.T

  3. #3
    SitePoint Wizard bronze trophy
    Join Date
    Oct 2001
    Location
    Vancouver BC Canada
    Posts
    2,037
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    Wicked, Thanks for the update!

    Cheers,
    Andrew
    Andrew Wasson | www.lunadesign.org
    Principal / Internet Development


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •