blob: 19a3c82eac779e2565897a7173a6a37e586682b3 (
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
38
39
|
# frozen_string_literal: true
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
|