diff options
Diffstat (limited to 'spec/workers/partition_creation_worker_spec.rb')
-rw-r--r-- | spec/workers/partition_creation_worker_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/workers/partition_creation_worker_spec.rb b/spec/workers/partition_creation_worker_spec.rb index 50ed9c901c1..37225cc1f79 100644 --- a/spec/workers/partition_creation_worker_spec.rb +++ b/spec/workers/partition_creation_worker_spec.rb @@ -4,16 +4,26 @@ require "spec_helper" RSpec.describe PartitionCreationWorker do describe '#perform' do - let(:creator) { double(create_partitions: nil) } + subject { described_class.new.perform } + + let(:creator) { instance_double('PartitionCreator', create_partitions: nil) } + let(:monitoring) { instance_double('PartitionMonitoring', report_metrics: nil) } before do allow(Gitlab::Database::Partitioning::PartitionCreator).to receive(:new).and_return(creator) + allow(Gitlab::Database::Partitioning::PartitionMonitoring).to receive(:new).and_return(monitoring) end it 'delegates to PartitionCreator' do expect(creator).to receive(:create_partitions) - described_class.new.perform + subject + end + + it 'reports partition metrics' do + expect(monitoring).to receive(:report_metrics) + + subject end end end |