diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-04-15 02:19:11 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-04-15 02:19:11 +0100 |
commit | e68a83c9ecdc5b9395e0dde687cafdf8330f9de0 (patch) | |
tree | a7fda19905bc7fb98a1c7d371d648c7db2c83665 | |
parent | bbe0a507f287c20ab4ae8a244fbfc810665deda5 (diff) | |
download | rails-e68a83c9ecdc5b9395e0dde687cafdf8330f9de0.tar.gz rails-e68a83c9ecdc5b9395e0dde687cafdf8330f9de0.tar.bz2 rails-e68a83c9ecdc5b9395e0dde687cafdf8330f9de0.zip |
Refactor test to avoid hackery
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index afc830cae9..49a1c117bc 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -516,10 +516,10 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase end def test_has_many_through_collection_size_uses_counter_cache_if_it_exists - author = authors(:david) - author.stubs(:_read_attribute).with('comments_count').returns(100) - assert_equal 100, author.comments.size - assert !author.comments.loaded? + c = categories(:general) + c.categorizations_count = 100 + assert_equal 100, c.categorizations.size + assert !c.categorizations.loaded? end def test_adding_junk_to_has_many_through_should_raise_type_mismatch |