aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/associations/join_model_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/associations/join_model_test.rb')
-rw-r--r--activerecord/test/associations/join_model_test.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/associations/join_model_test.rb b/activerecord/test/associations/join_model_test.rb
index a24763b92e..d18c878733 100644
--- a/activerecord/test/associations/join_model_test.rb
+++ b/activerecord/test/associations/join_model_test.rb
@@ -451,6 +451,12 @@ class AssociationsJoinModelTest < Test::Unit::TestCase
assert_nothing_raised { vertices(:vertex_1).sinks << vertices(:vertex_5) }
end
+ def test_has_many_through_collection_size_doesnt_load_target_if_not_loaded
+ author = authors(:david)
+ assert_equal 9, author.comments.size
+ assert !author.comments.loaded?
+ end
+
def test_adding_junk_to_has_many_through_should_raise_type_mismatch
assert_raise(ActiveRecord::AssociationTypeMismatch) { posts(:thinking).tags << "Uhh what now?" }
end