Commit beffbc8a authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix mocks in background migrations specs

parent 433b6d2c
......@@ -32,7 +32,6 @@ module Gitlab
# arguments - The arguments to pass to the background migration's "perform"
# method.
def self.perform(class_name, arguments)
puts class_name
const_get(class_name).new.perform(*arguments)
end
end
......
......@@ -10,12 +10,16 @@ describe Gitlab::BackgroundMigration do
describe '.steal' do
context 'when there are enqueued jobs present' do
let(:queue) { [double(:job, args: ['Foo', [10, 20]])] }
let(:job) { double(:job, args: ['Foo', [10, 20]]) }
let(:queue) { [job] }
before do
allow(Sidekiq::Queue).to receive(:new)
.with(described_class.queue)
.and_return(queue)
allow(job).to receive(:queue)
.and_return(described_class.queue)
end
it 'steals jobs from a queue' do
......
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