Skip to content

Commit

Permalink
disable 'should not detect unused preload post => comment with empty?…
Browse files Browse the repository at this point in the history
…' test for AR 4.0
  • Loading branch information
flyerhzm committed Nov 5, 2023
1 parent 6beb6cb commit 4f61a2f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions spec/integration/active_record/association_spec.rb
Expand Up @@ -88,12 +88,14 @@
expect(Bullet::Detector::Association).to be_detecting_unpreloaded_association_for(Post, :comments)
end

it 'should not detect unused preload post => comment with empty?' do
Post.includes(:comments).each { |post| post.comments.empty? }
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations
if ActiveRecord::VERSION::MAJOR != 4 && ActiveRecord::VERSION::MINOR != 0
it 'should not detect unused preload post => comment with empty?' do
Post.includes(:comments).each { |post| post.comments.empty? }
Bullet::Detector::UnusedEagerLoading.check_unused_preload_associations
expect(Bullet::Detector::Association).not_to be_has_unused_preload_associations

expect(Bullet::Detector::Association).to be_completely_preloading_associations
expect(Bullet::Detector::Association).to be_completely_preloading_associations
end
end

it 'should not detect unused preload post => comment with count' do
Expand Down

0 comments on commit 4f61a2f

Please sign in to comment.