aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/join_model_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/associations/join_model_test.rb')
-rw-r--r--activerecord/test/cases/associations/join_model_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb
index e128d6dda3..c24a94bfc4 100644
--- a/activerecord/test/cases/associations/join_model_test.rb
+++ b/activerecord/test/cases/associations/join_model_test.rb
@@ -290,6 +290,11 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase
assert_equal nil, authors(:david).categories.find_by_name('Technology')
end
+ def test_has_many_array_methods_called_by_method_missing
+ assert true, authors(:david).categories.any? { |category| category.name == 'General' }
+ assert_nothing_raised { authors(:david).categories.sort }
+ end
+
def test_has_many_going_through_join_model_with_custom_foreign_key
assert_equal [], posts(:thinking).authors
assert_equal [authors(:mary)], posts(:authorless).authors