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

pipeline_success_worker_spec.rb « workers « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d1c84adda6f9fb91aa5b08f9919e5e0e58a9f98c (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
require 'spec_helper'

describe PipelineSuccessWorker do
  describe '#perform' do
    context 'when pipeline exists' do
      let(:pipeline) { create(:ci_pipeline, status: 'success') }

      it 'performs "merge when pipeline succeeds"' do
        expect_any_instance_of(
          MergeRequests::MergeWhenPipelineSucceedsService
        ).to receive(:trigger)

        described_class.new.perform(pipeline.id)
      end
    end

    context 'when pipeline does not exist' do
      it 'does not raise exception' do
        expect { described_class.new.perform(123) }
          .not_to raise_error
      end
    end
  end
end