Commit de16b6d3 authored by Dmitry Gruzd's avatar Dmitry Gruzd

Fix prepare_commits_for_rendering N+1 spec

parent 702b46ae
...@@ -64,6 +64,12 @@ RSpec.describe RendersCommits do ...@@ -64,6 +64,12 @@ RSpec.describe RendersCommits do
subject.prepare_commits_for_rendering(merge_request.commits.take(1)) subject.prepare_commits_for_rendering(merge_request.commits.take(1))
end end
# Populate Banzai::Filter::References::ReferenceCache
subject.prepare_commits_for_rendering(merge_request.commits)
# Reset lazy_latest_pipeline cache to simulate a new request
BatchLoader::Executor.clear_current
expect do expect do
subject.prepare_commits_for_rendering(merge_request.commits) subject.prepare_commits_for_rendering(merge_request.commits)
merge_request.commits.each(&:latest_pipeline) merge_request.commits.each(&:latest_pipeline)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment