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

failed_unmet_prerequisites_spec.rb « build « status « ci « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a4854bdc6b98a0806aecec56a26dfdfc88061fef (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
30
31
32
33
34
35
36
37
require 'spec_helper'

RSpec.describe Gitlab::Ci::Status::Build::FailedUnmetPrerequisites do
  describe '#illustration' do
    subject { described_class.new(double).illustration }

    it { is_expected.to include(:image, :size, :title, :content) }
  end

  describe '.matches?' do
    let(:build) { create(:ci_build, :created) }

    subject { described_class.matches?(build, double) }

    context 'when build has not failed' do
      it { is_expected.to be_falsey }
    end

    context 'when build has failed' do
      before do
        build.drop!(failure_reason)
      end

      context 'with unmet prerequisites' do
        let(:failure_reason) { :unmet_prerequisites }

        it { is_expected.to be_truthy }
      end

      context 'with a different error' do
        let(:failure_reason) { :runner_system_failure }

        it { is_expected.to be_falsey }
      end
    end
  end
end