summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-13 12:05:06 +0200
committerGrzegorz Bizon <grzesiek.bizon@gmail.com>2017-07-13 12:08:03 +0200
commitbeffbc8aa2845d7a2859c269fd2c891cddb308e6 (patch)
tree0c9472dfed0e7cd2b73f02fd1d70211a1c02cdbc
parent433b6d2c65f0018fa67e2d8905d1cba75e7990fa (diff)
downloadgitlab-ce-beffbc8aa2845d7a2859c269fd2c891cddb308e6.tar.gz
Fix mocks in background migrations specs
-rw-r--r--lib/gitlab/background_migration.rb1
-rw-r--r--spec/lib/gitlab/background_migration_spec.rb6
2 files changed, 5 insertions, 2 deletions
diff --git a/lib/gitlab/background_migration.rb b/lib/gitlab/background_migration.rb
index 73688421e74..e0325c0138e 100644
--- a/lib/gitlab/background_migration.rb
+++ b/lib/gitlab/background_migration.rb
@@ -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
diff --git a/spec/lib/gitlab/background_migration_spec.rb b/spec/lib/gitlab/background_migration_spec.rb
index 55bf7040ef3..2f3e7aba1f4 100644
--- a/spec/lib/gitlab/background_migration_spec.rb
+++ b/spec/lib/gitlab/background_migration_spec.rb
@@ -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