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:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 12:09:31 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-03-18 12:09:31 +0300
commit6763d2787670bc03a36a8eb601703e88fc70dece (patch)
treeedc653ffd3052e3f9898c4fa8a07621d51574767 /spec/workers
parented9165c2abda1dca048a8d3cb8030d906c0bbb0c (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/workers')
-rw-r--r--spec/workers/ci/daily_report_results_worker_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/workers/ci/daily_report_results_worker_spec.rb b/spec/workers/ci/daily_report_results_worker_spec.rb
new file mode 100644
index 00000000000..b6543b32b09
--- /dev/null
+++ b/spec/workers/ci/daily_report_results_worker_spec.rb
@@ -0,0 +1,34 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe Ci::DailyReportResultsWorker do
+ 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
+ expect_any_instance_of(Ci::DailyReportResultService)
+ .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
+ expect_any_instance_of(Ci::DailyReportResultService)
+ .not_to receive(:execute)
+
+ expect { subject }
+ .not_to raise_error
+ end
+ end
+ end
+end