debian-mirror-gitlab/spec/workers/ci/daily_build_group_report_results_worker_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
815 B
Ruby
Raw Normal View History

2020-04-22 19:07:51 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe Ci::DailyBuildGroupReportResultsWorker do
2020-04-22 19:07:51 +05:30
describe '#perform' do
let!(:pipeline) { create(:ci_pipeline) }
subject { described_class.new.perform(pipeline_id) }
context 'when pipeline is found' do
let(:pipeline_id) { pipeline.id }
it 'executes service' do
2020-05-24 23:13:21 +05:30
expect_any_instance_of(Ci::DailyBuildGroupReportResultService)
2020-04-22 19:07:51 +05:30
.to receive(:execute).with(pipeline)
subject
end
end
context 'when pipeline is not found' do
let(:pipeline_id) { 123 }
it 'does not execute service' do
2020-05-24 23:13:21 +05:30
expect_any_instance_of(Ci::DailyBuildGroupReportResultService)
2020-04-22 19:07:51 +05:30
.not_to receive(:execute)
expect { subject }
.not_to raise_error
end
end
end
end