mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Refactor test to avoid hackery
This commit is contained in:
parent
bbe0a507f2
commit
e68a83c9ec
1 changed files with 4 additions and 4 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue