Commit beffbc8a authored by Grzegorz Bizon's avatar Grzegorz Bizon

Fix mocks in background migrations specs

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