aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activerecord/test/cases/associations_test.rb')
-rw-r--r--activerecord/test/cases/associations_test.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index c6769edcbf..72963fd56c 100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
@@ -264,6 +264,11 @@ class AssociationProxyTest < ActiveRecord::TestCase
end
end
+ test "first! works on loaded associations" do
+ david = authors(:david)
+ assert_equal david.posts.first, david.posts.reload.first!
+ end
+
def test_reset_unloads_target
david = authors(:david)
david.posts.reload