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

create_trace_artifact_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 854abd9cca77eb0aa35fc983d27c125b69cb856f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
require 'spec_helper'

describe CreateTraceArtifactWorker do
  describe '#perform' do
    subject { described_class.new.perform(job&.id) }

    context 'when job is found' do
      let(:job) { create(:ci_build) }

      it 'executes service' do
        expect_any_instance_of(Ci::CreateTraceArtifactService)
          .to receive(:execute).with(job)

        subject
      end
    end

    context 'when job is not found' do
      let(:job) { nil }

      it 'does not execute service' do
        expect_any_instance_of(Ci::CreateTraceArtifactService)
          .not_to receive(:execute)

        subject
      end
    end
  end
end