diff options
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 4316aa98d4..abf43cea98 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -483,7 +483,7 @@ class RelationTest < ActiveRecord::TestCase posts = Post.scoped assert_equal [0], posts.select('comments_count').where('id is not null').group('id').order('id').count.values.uniq - assert_equal 0, posts.where('id is not null').select('comments_count').count + assert_equal 7, posts.where('id is not null').select('comments_count').count assert_equal 7, posts.select('comments_count').count('id') assert_equal 0, posts.select('comments_count').count @@ -619,4 +619,8 @@ class RelationTest < ActiveRecord::TestCase def test_order_by_relation_attribute assert_equal Post.order(Post.arel_table[:title]).all, Post.order("title").all end + + def test_relations_limit_with_conditions_or_limit + assert_equal Post.limit(2).size, Post.limit(2).all.size + end end |