SitePoint Sponsor |
|
User Tag List
Results 1 to 2 of 2
Thread: Raisl Book: Chapter 9 rake tests
-
Nov 16, 2007, 14:36 #1
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?
-
Nov 19, 2007, 13:42 #2
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