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

skipped_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: 46f6933025add2ca6bd4d3ae93aefc115ec330b0 (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
require 'spec_helper'

describe Gitlab::Ci::Status::Build::Skipped do
  let(:user) { create(:user) }

  subject do
    described_class.new(double('subject'))
  end

  describe '#illustration' do
    it { expect(subject.illustration).to include(:image, :size, :title) }
  end

  describe '.matches?' do
    subject {described_class.matches?(build, user) }

    context 'when build is skipped' do
      let(:build) { create(:ci_build, :skipped) }

      it 'is a correct match' do
        expect(subject).to be true
      end
    end

    context 'when build is not skipped' do
      let(:build) { create(:ci_build) }

      it 'does not match' do
        expect(subject).to be false
      end
    end
  end
end