Commit 3b8a4a47 authored by Alex Kalderimis's avatar Alex Kalderimis

Assert that we pass at most QUERY_LIMIT items to be moved

parent 299e26be
...@@ -38,7 +38,11 @@ RSpec.describe IssuePlacementWorker do ...@@ -38,7 +38,11 @@ RSpec.describe IssuePlacementWorker do
end end
it 'limits the sweep to QUERY_LIMIT records' do it 'limits the sweep to QUERY_LIMIT records' do
create_list(:issue, described_class::QUERY_LIMIT - 5, **unplaced) # Ensure there are more than N issues in this set
n = described_class::QUERY_LIMIT
create_list(:issue, n - 5, **unplaced)
expect(Issue).to receive(:move_nulls_to_end).with(have_attributes(count: n)).and_call_original
described_class.new.perform(issue.id) described_class.new.perform(issue.id)
......
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