SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member jennifert's Avatar
    Join Date
    Oct 2007
    Location
    Canada
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Raisl Book: Chapter 9 rake tests

    Anyone else having trouble running the rake test suit? It seems like for every chapter I run into problems...even after double checking codes and even copying the code from the achieve.

    Also, I am getting a lot of messages similar to:

    ..........DEPRECATION WARNING: stories_count See http://www.r
    recation for details. (called from stories_count at c:/ruby/li
    ms/activerecord-1.15.3/lib/active_record/deprecated_associatio
    ..DEPRECATION WARNING: votes_count See http://www.rubyonrails
    or details. (called from votes_count at c:/ruby/lib/ruby/gems/
    ord-1.15.3/lib/active_record/deprecated_associations.rb:7)


    Is anyone experiencing these problems? I am using the the latest rails and ruby 1.8.6 RC2.

    has anyone chnaged their code after the depreciated warning? Did pass test after?

  2. #2
    SitePoint Member jennifert's Avatar
    Join Date
    Oct 2007
    Location
    Canada
    Posts
    13
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up solved!

    The index.rhtml file should read:

    Code Ruby:
    <h2><%= story_list_heading %></h2>
    <%= render :partial => 'story', :collection => @stories %>

    also, in the test controller find:
    Code Ruby:
    def test_should_accept_vote
        assert ! stories(:another).has_votes?
        post_with_user :vote, :id => 2
        assert assigns(:another).has_votes?
    end

    and replace with:
    Code Ruby:
    def test_should_accept_vote
        assert ! stories(:another).has_votes?
        post_with_user :vote, :id => 2
        assert assigns(:story).reload.has_votes?
      end


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
  •