diff options
Diffstat (limited to 'activerecord/test/cases/associations_test.rb')
-rw-r--r-- | activerecord/test/cases/associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb index b7c2bcad00..c0f1945cec 100644 --- a/activerecord/test/cases/associations_test.rb +++ b/activerecord/test/cases/associations_test.rb @@ -218,6 +218,13 @@ class AssociationProxyTest < ActiveRecord::TestCase def test_scoped_allows_conditions assert developers(:david).projects.merge!(where: 'foo').where_values.include?('foo') end + + test "getting a scope from an association" do + david = developers(:david) + + assert david.projects.scope.is_a?(ActiveRecord::Relation) + assert_equal david.projects, david.projects.scope + end end class OverridingAssociationsTest < ActiveRecord::TestCase |