Skip to content

Commit

Permalink
Call check_unused_preload_associations in spec
Browse files Browse the repository at this point in the history
Some specs miss the `check_unused_preload_associations` call to execute
the check.
  • Loading branch information
Darren Chang committed Jan 10, 2019
1 parent 2e83c5b commit 314a43d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions spec/integration/active_record/association_spec.rb
Expand Up @@ -331,7 +331,7 @@
expect(Bullet::Detector::Association).to be_completely_preloading_associations
end

it 'should dtect preload with comment => post' do
it 'should detect preload with comment => post' do
Comment.includes(:post).each do |comment|
comment.post.name
end
Expand Down Expand Up @@ -362,6 +362,7 @@

new_post.trigger_after_save = true
new_post.save!
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
Expand All @@ -374,7 +375,7 @@
comment.post = post
# loading it should not trigger anything
comment.post

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
end
Expand Down

0 comments on commit 314a43d

Please sign in to comment.