2019-04-01 06:11:08 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe UpdateProjectStatisticsWorker do
|
|
|
|
let(:worker) { described_class.new }
|
|
|
|
let(:project) { create(:project, :repository) }
|
2019-04-05 13:07:09 +00:00
|
|
|
let(:statistics) { %w(repository_size) }
|
2019-04-01 06:11:08 +00:00
|
|
|
|
|
|
|
describe '#perform' do
|
2019-04-05 13:07:09 +00:00
|
|
|
it 'updates the project statistics' do
|
|
|
|
expect(Projects::UpdateStatisticsService).to receive(:new)
|
|
|
|
.with(project, nil, statistics: statistics)
|
|
|
|
.and_call_original
|
2019-04-01 06:11:08 +00:00
|
|
|
|
2019-04-05 13:07:09 +00:00
|
|
|
worker.perform(project.id, statistics)
|
2019-04-01 06:11:08 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|