Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/workers/build_finished_worker_spec.rb')
-rw-r--r--spec/workers/build_finished_worker_spec.rb20
1 files changed, 8 insertions, 12 deletions
diff --git a/spec/workers/build_finished_worker_spec.rb b/spec/workers/build_finished_worker_spec.rb
index 02e15b7bc22..6d040f83dc7 100644
--- a/spec/workers/build_finished_worker_spec.rb
+++ b/spec/workers/build_finished_worker_spec.rb
@@ -11,20 +11,16 @@ RSpec.describe BuildFinishedWorker do
context 'when build exists' do
let!(:build) { create(:ci_build) }
- it 'calculates coverage and calls hooks', :aggregate_failures do
- trace_worker = double('trace worker')
- coverage_worker = double('coverage worker')
-
- allow(BuildTraceSectionsWorker).to receive(:new).and_return(trace_worker)
- allow(BuildCoverageWorker).to receive(:new).and_return(coverage_worker)
+ before do
+ expect(Ci::Build).to receive(:find_by).with(id: build.id).and_return(build)
+ end
- # Unfortunately, `ordered` does not seem to work when called within `allow_next_instance_of`
- # so we're doing this the long and dirty way
- expect(trace_worker).to receive(:perform).ordered
- expect(coverage_worker).to receive(:perform).ordered
+ it 'calculates coverage and calls hooks', :aggregate_failures do
+ expect(build).to receive(:parse_trace_sections!).ordered
+ expect(build).to receive(:update_coverage).ordered
- expect_next_instance_of(Ci::BuildReportResultWorker) do |instance|
- expect(instance).to receive(:perform)
+ expect_next_instance_of(Ci::BuildReportResultService) do |build_report_result_service|
+ expect(build_report_result_service).to receive(:execute).with(build)
end
expect(BuildHooksWorker).to receive(:perform_async)